News for hackers. Stuff that matters.
Re:D as a Better C by lambda on Wednesday August 23, 2017 @12:49PM (#15083042)
Have you looked at Rust? It uses Option types, has generics, also uses return values for error handling but has a lot more syntactic sugar to make it cleaner than in Go.
Re:D as a Better C by christophilus on Wednesday August 23, 2017 @02:30PM (#15083894)
I have tried Rust in the past, though not on this particular hobby project (my Clojure interpreter). I found it hard to get into, and I've gotten into a lot of languages in my time-- some of which are considered challenging (e.g. Haskell). With Rust, I always felt I spent too much time wrestling with it, and not enough time being productive. I imagine that you hit a threshold at some point and that begins to change. But for my side projects, that bar wasn't worth jumping.
Re:D as a Better C by steveklabnik on Wednesday August 23, 2017 @02:58PM (#15084142)
Rust's major goals this year are around learnability and productivity; maybe come check it out again someday :)
Re:D as a Better C by theprotocol on Wednesday August 23, 2017 @03:47PM (#15084477)
Could you point to any materials (e.g. blog post, roadmap document...) that deal with this? Thanks.
Re:D as a Better C by steveklabnik on Wednesday August 23, 2017 @04:06PM (#15084589)
https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.ht... is our "the year is half over" update, and has a link to the overall goals right at the top.
Re:D as a Better C by theprotocol on Wednesday August 23, 2017 @05:14PM (#15085248)
Awesome, thanks!
Re:D as a Better C by OoooooooO on Wednesday August 23, 2017 @06:27PM (#15085741)
Inferred lifetimes? A man can hope :).
Re:D as a Better C by dbaupp on Wednesday August 23, 2017 @08:17PM (#15086499)
Inferring lifetimes from the implementation of a function won't happen for the same reason that inferring types won't happen: it is really nice for the signature of a function to not automatically be changed if the body is changed, instead programmers should be told when they might be breaking their users.

However, the compiler could (and did, I believe) run inference and suggest a fix that the programmer can explicitly include.

Re:D as a Better C by steveklabnik on Wednesday August 23, 2017 @06:51PM (#15085886)
If it were always possible to infer all lifetimes, we'd do it. Unfortunately that's not the case.

There are a number of RFCs in the pipeline to help with lifetimes, including more elision. In no particular order:

https://github.com/rust-lang/rfcs/pull/2115

https://github.com/rust-lang/rfcs/pull/2094

https://github.com/rust-lang/rfcs/pull/2093

Re:D as a Better C by knowThySelfx on Thursday August 24, 2017 @01:27AM (#15087808)
Rust's documentation is very well written. The authors have put in great effort to make things clear.

Granted Rust has some paradigms and constructs which are not easy to learn, I found it rather exciting. I think it has future scope.

Wonder whats happening with Redox. I hope Rust adds more libraries, especially network related, since the networked world is increasingly looking like a distributed OS of sort. Browsers are looking like an OS or a shell inside the OS. Browsers are getting more complex with more functionalities added every few months. Not sure I expressed my thoughts correctly, but I guess one can understand what I mean.

Rust should move away from C standard library, if possible.

Re:D as a Better C by steveklabnik on Thursday August 24, 2017 @11:34AM (#15090936)
> Wonder whats happening with Redox.

They've been involved in Google Summer of Code, and so have had lots of status update posts lately, here's the latest: https://redox-os.org/news/gsoc-self-hosting-final/

> Rust should move away from C standard library, if possible.

It's not always possible, but on systems where it is, there's some ability to do so, see https://github.com/japaric/steed

Re:D as a Better C by knowThySelfx on Friday August 25, 2017 @05:41AM (#15097233)
Thanks Steve.

>It's not always possible, but on systems where it is, there's some ability to do so, see https://github.com/japaric/steed

Doesn't linking to it make a Rust program "unsafe", in the Rust sense? Or my understanding is probably not correct.

Re:D as a Better C by steveklabnik on Friday August 25, 2017 @10:43AM (#15098794)
Using unsafe inside of safe is totally fine. See https://doc.rust-lang.org/nomicon/safe-unsafe-meaning.html for more.
Re:D as a Better C by knowThySelfx on Saturday August 26, 2017 @09:30AM (#15105335)
Cheers, thanks.