From owner-freebsd-hackers@freebsd.org Tue Jan 1 08:00:30 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 566BA1421D70 for ; Tue, 1 Jan 2019 08:00:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5318C89990 for ; Tue, 1 Jan 2019 08:00:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id eEyJgT7Fk82YceEyKgEK7p; Tue, 01 Jan 2019 01:00:21 -0700 X-Authority-Analysis: v=2.3 cv=NNSrBHyg c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=xfDLHkLGAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=vvzosrtTAAAA:8 a=BSQElrNbAAAA:8 a=vUPWEWiMAAAA:8 a=JWQBLmsMjAVFHeIbQi4A:9 a=tNccYuw41oiB4F14:21 a=pXftPBHPoqHe86gL:21 a=x1R0UGTAkW6TYUu2:21 a=CjuIK1q_8ugA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=Yh4UkvJ32wUMdh-0CJ9c:22 a=1qJf2DZE6a0S-owCXwfk:22 a=s3Yi14Of9AgBIP63TAoC:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 03D8B24F2; Tue, 1 Jan 2019 00:00:19 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0180Ic8058671; Tue, 1 Jan 2019 00:00:18 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0180Is3058668; Tue, 1 Jan 2019 00:00:18 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901010800.x0180Is3058668@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Damjan Jovanovic cc: Cy Schubert , Hackers freeBSD Subject: Re: Speculative: Rust for base system components In-Reply-To: Message from Damjan Jovanovic of "Tue, 01 Jan 2019 08:14:47 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 01 Jan 2019 00:00:18 -0800 X-CMAE-Envelope: MS4wfLjb7mmd+ybD5szyaBzGB+tsyZ2aRxWbGKCsJADo4PK2il3y7fLRGLZ7ipOX0n3mo22W5FBGhO4DH8SdrCpmACm2PaDEP3lr6DcIDqTjND87jAPLrbBZ UmphRLb539c6q0pOe9SPpOxwHXylHXZSvrY7U3DZMwMnYmlOfeFMz1co9fsvCvhavc3jAhpwQXVGvXfeWtZgYWuxfhQCBvnS3oyZl5+Wju4T818AovVr3AMS X-Rspamd-Queue-Id: 5318C89990 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-3.88 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.54)[-0.542,0]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; IP_SCORE(-1.62)[ip: (-3.69), ipnet: 64.59.128.0/20(-2.41), asn: 6327(-1.93), country: CA(-0.09)] 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 08:00:30 -0000 In message , Damjan Jovanovic writes: > --000000000000caa538057e5f7945 > Content-Type: text/plain; charset="UTF-8" > > 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. Microsoft renders fonts in the kernel too. Look at the (security) trouble that that's caused them. C++ exception handling (which can be "muted" and not recommended) isn't best practice for kernel programming. Are you sure you want C++, C#, Java, Javascript (also discussed at OpenHack), or rust in the kernel. Really? Not being rhetorical here but Microsoft isn't a great a example of we should strive for. I'm with Warner. No. Rust should remain in ports. Apps that depend on rust should be in ports. Optional kernel modules should also be in ports. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. > 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" > > > > --000000000000caa538057e5f7945 > Content-Type: text/html; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > >
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.
<= > div>
The bigger benefit of running Java applications (not dev= > ice drivers) in the kernel is performance. If applications run in kernel mo= > de, context switching between kernel threads is much faster than user threa= > ds, system calls just become function calls, etc. Unlike C, Java can be san= > dboxed (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, w= > hich used such techniques to run safely C# applications in the kernel, and = > it was about 20% faster than C in user space.

ail_quote">
On Tue, Jan 1, 2019 at 6:59 AM Cy Schubert <= > Cy.Schubert@cschubert.com&= > gt; wrote:
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What = > would having another language in base buy us? This reminds me of a couple o= > f months ago at OpenHack Victoria someone was trying to convince me that th= > e 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 wri= > tten 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
> <Cy.Schub= > ert@cschubert.com> or < =3D"_blank">cy@freebsd.org>
> 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 < ybrid-lab.co.uk" target=3D"_blank">igor@hybrid-lab.co.uk> wrote:
> >Quite frankly the compile time isn't really *that* important,
>
> I disagree.=C2=A0 FreeBSD seems to be heading back to the batch days - you<= > br> > submit your buildworld request and come back tomorrow to see if it worked.<= > br> > That is a significant hinderance to development and, based on various
> mailing list comments, is causing breakage because developers are cutting r> > corners due to the pain involved in running "make universe" befor= > e 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 r> > >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 dependenc= > y
> 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).=C2=A0 This means that a significant part of the work will be re-writ= > ing
> the FreeBSD build system into something else like (eg) Bazel.
> 2) The bottleneck very quickly turns into the linker.
>
> --
> Peter Jeremy
> _______________________________________________
> freebsd-ha= > ckers@freebsd.org mailing list
> =3D"noreferrer" target=3D"_blank">https://lists.freebsd.org/mailman/listinf= > o/freebsd-hackers
> To unsubscribe, send any mail to " subscribe@freebsd.org" target=3D"_blank">freebsd-hackers-unsubscribe@freebs= > d.org"
>
> > --000000000000caa538057e5f7945--