From owner-freebsd-hackers@freebsd.org Tue Jan 1 06:16:56 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD5F8148DF17 for ; Tue, 1 Jan 2019 06:16:55 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF0FA812BA for ; Tue, 1 Jan 2019 06:16:54 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: by mail-oi1-x229.google.com with SMTP id i6so22974012oia.6 for ; Mon, 31 Dec 2018 22:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xSC0jbB4lgDxdP7JXyuwSnOAVESc0L37TeYLcxzdOps=; b=SDu6FZYxcU9fdJkvoLwU28pahGyORD6Vvb+Qy6oICPgmMTwh2eYG85zka1jli2Jeu2 IrRzpvE7Jj7C1J/4MW6n+VJU0sTCLQkosDX323/bjuofTEJYIGtGBlMQFrfVUOXT06lv lotYvAhauFlLraQuoKHjwoxfRGDopxheDg8l6e//BvvZaLfPhVjFVcPNvjbrRL8LTD5Q e1SN6cRWQnW/5o5qGeMlLfamJmjfMFO2aL7d7Dq4zdIO5JdmkTmfqUboQSpBvgkKhTyj M/Llz/p0si9IfEMLZLJIo5y9p4+Tu9Rj1Rt8M1HgnhdJRODEzaCco2fdq/oC95p1jYL0 e4NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xSC0jbB4lgDxdP7JXyuwSnOAVESc0L37TeYLcxzdOps=; b=NARp6PCBJ1yRHfDxEYIDuzupLzXKSk5EHJcr2nVoG3nEFIQ/ABy0lttAT/s9uOJ9Fm 6h2vr6y5d8U6QLyX6CHErU6V7sQfWNs7o+oqXCsGkGwIR8e2YSinMfByi1Qi+nuurp7U z0piAAXz+7d7td2J5fJoQYvF9HpPK3ZSEnOTohNlIY1yqT9hv3YNm3mL41/j10FAKQVr H1MtGYUcp1arKKKYG1S8F1okScdTLuZeO9dP1J04nIrXEKK95U5ln/isz/+2ME2pqVGu AEmdZt8tv54cHPCpeVOLJV6hOHvwaAEZ9rJqEOeUYnAe3UNgSx8Ol4+1hVlGfe+eBrr/ r4IA== X-Gm-Message-State: AJcUukeoubmVd8L+Ey/+++nz2hDt2bdYbQ3VbF4igya9FFjrB1GV/Iy9 opTpfNb3QpxlwNr52c2HC4MlDwq14ljcoQWoW9/zUt7GgLL3GQ== X-Google-Smtp-Source: AFSGD/Xf1F8NfQdYPXXa6hSKYKR2JJi12g9Db6i875LcjcKF2XIJWFI7A2N3yTpJZDAwUo5B/u5sXxngipHiUdU50NQ= X-Received: by 2002:aca:e5cb:: with SMTP id c194mr25442526oih.175.1546323413867; Mon, 31 Dec 2018 22:16:53 -0800 (PST) MIME-Version: 1.0 References: <20190101045638.D280E1F56@spqr.komquats.com> In-Reply-To: <20190101045638.D280E1F56@spqr.komquats.com> From: Damjan Jovanovic Date: Tue, 1 Jan 2019 08:14:47 +0200 Message-ID: Subject: Re: Speculative: Rust for base system components To: Cy Schubert Cc: Hackers freeBSD X-Rspamd-Queue-Id: DF0FA812BA X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=SDu6FZYx; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of damjanjov@gmail.com designates 2607:f8b0:4864:20::229 as permitted sender) smtp.mailfrom=damjanjov@gmail.com X-Spamd-Result: default: False [-5.44 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.100,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[9.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.53)[ip: (-9.03), ipnet: 2607:f8b0::/32(-1.96), asn: 15169(-1.57), country: US(-0.08)]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 06:16:56 -0000 Kernel modules in Rust might benefit from the better type checking and thus less memory leaks, less memory corruption, etc. but they are usually small anyway so it's probably not worth it. The bigger benefit of running Java applications (not device drivers) in the kernel is performance. If applications run in kernel mode, context switching between kernel threads is much faster than user threads, system calls just become function calls, etc. Unlike C, Java can be sandboxed (at least in theory), and lack of native pointers and memory safety ensure it cannot access hardware directly anyway, so the rest of the system is still protected. Around 2005, Microsoft Research made Singularity OS, which used such techniques to run safely C# applications in the kernel, and it was about 20% faster than C in user space. On Tue, Jan 1, 2019 at 6:59 AM Cy Schubert wrote: > What would having another language in base buy us? This reminds me of a > couple of months ago at OpenHack Victoria someone was trying to convince me > that the kernel needed a JavaVM. (Sure we each had a few beers) but the > similarity of this discussion doesn't escape me. Kernel modules and > functions written in java^H^H^H^H rust: why? > > --- > Sent using a tiny phone keyboard. > Apologies for any typos and autocorrect. > Also, this old phone only supports top post. Apologies. > > Cy Schubert > or > The need of the many outweighs the greed of the few. > --- > > -----Original Message----- > From: Peter Jeremy > Sent: 31/12/2018 18:48 > To: Igor Mozolevsky > Cc: Hackers freeBSD > Subject: Re: Speculative: Rust for base system components > > On 2019-Jan-01 00:53:48 +0000, Igor Mozolevsky > wrote: > >Quite frankly the compile time isn't really *that* important, > > I disagree. FreeBSD seems to be heading back to the batch days - you > submit your buildworld request and come back tomorrow to see if it worked. > That is a significant hinderance to development and, based on various > mailing list comments, is causing breakage because developers are cutting > corners due to the pain involved in running "make universe" before they > make a large change. > > >longer (if not much longer) build times might push toward a better > >modularisation and compartmentalisation of the OS and the kernel so a > >small change in the kernel, for example, doesn't require the > >recompilation of the whole damn thing when nothing else is affected. > > Two problems here: > 1) make doesn't seem to be sufficient to correctly describe a dependency > tree to allow incremental/partial builds (at, everyone I'm aware of who > has a successful incremental build system has started by migrating off > make). This means that a significant part of the work will be re-writing > the FreeBSD build system into something else like (eg) Bazel. > 2) The bottleneck very quickly turns into the linker. > > -- > Peter Jeremy > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >