looks like Haskell
looks like Haskell
Posted Apr 17, 2013 23:07 UTC (Wed) by JoeBuck (subscriber, #2330)Parent article: A taste of Rust
Or rather, an attempt to take ideas from Haskell without requiring the programmer to do everything in a functional way.
Posted Apr 17, 2013 23:47 UTC (Wed)
by ncm (guest, #165)
[Link] (4 responses)
Posted Apr 18, 2013 5:52 UTC (Thu)
by nevyn (guest, #33129)
[Link]
So the "managed" allocated data using reference counts and thus. having RAII like properties is guaranteed to continue to exist?
Posted Apr 19, 2013 8:21 UTC (Fri)
by k8to (guest, #15413)
[Link] (1 responses)
Posted Apr 24, 2013 20:36 UTC (Wed)
by Tuna-Fish (guest, #61751)
[Link]
It's a tradeoff. Fundamentally, if a language or system wants to be really good on one metric, it has to sacrifice some of the other. OCaml and Rust choose different points, and there is nothing wrong with the choice of either. However, this does mean that there are some tasks where Rust is better suited.
Posted Apr 22, 2013 1:33 UTC (Mon)
by zooko (guest, #2589)
[Link]
Posted Apr 17, 2013 23:55 UTC (Wed)
by Cyberax (✭ supporter ✭, #52523)
[Link] (1 responses)
Posted Apr 18, 2013 3:47 UTC (Thu)
by ofranja (guest, #11084)
[Link]
Nice to hear about the language, it seems that they did a good research for gluing good things together, instead of implementing just more of the same old stuff. I'll keep an eye on it.
Posted Apr 17, 2013 23:57 UTC (Wed)
by mathstuf (subscriber, #69389)
[Link] (11 responses)
Posted Apr 18, 2013 0:56 UTC (Thu)
by droundy (subscriber, #4559)
[Link] (10 responses)
I love Haskell, but so far as I can tell, it's not playing the same game that rust is, which is creating a fast, safe, low-overhead language.
Posted Apr 18, 2013 1:58 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link] (2 responses)
That said, there is a lot of research going into making GHC generate good and fast code. There are certainly some very nice examples of GHC producing very fast code from fairly idiomatic Haskell. However, once you get past that cliff, things tend to get pretty hairy quickly.
Posted Apr 18, 2013 10:15 UTC (Thu)
by Auders (guest, #53318)
[Link] (1 responses)
Posted Apr 19, 2013 17:36 UTC (Fri)
by b7j0c (guest, #27559)
[Link]
you'll never purge Strings or laziness (or bang annotations etc) from hackage, most of those packages aren't that well maintained. rust is the reboot haskell needs.
Posted Apr 18, 2013 2:46 UTC (Thu)
by rsidd (subscriber, #2582)
[Link] (6 responses)
Posted Apr 19, 2013 9:24 UTC (Fri)
by peter-b (subscriber, #66996)
[Link] (4 responses)
Posted Apr 19, 2013 9:39 UTC (Fri)
by rsidd (subscriber, #2582)
[Link] (3 responses)
fib 0 = 0
is not just non-tail-recursive but incredibly inefficient. And every "functional" efficient version that I've seen is just too hard to understand (for me) by reading the code. And that's for a trivial beginner-level example.
Posted Apr 19, 2013 9:54 UTC (Fri)
by neilbrown (subscriber, #359)
[Link] (2 responses)
fib 0 = (1,1)
That's reasonably efficient - not sure how easy it is to make it tail recursive.
Posted Apr 19, 2013 10:19 UTC (Fri)
by rsidd (subscriber, #2582)
[Link]
Posted Apr 21, 2013 15:12 UTC (Sun)
by ballombe (subscriber, #9523)
[Link]
fib n = fibr n 1 1 where
(thought there are much faster algorithms to compute this)
Posted Apr 19, 2013 17:38 UTC (Fri)
by b7j0c (guest, #27559)
[Link]
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
Looks like something good
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
looks like Haskell
fib 1 = 0
fib n = fib (n-1) + fib (n-2)
looks like Haskell
fib n = (a+b, a) where (a,b) = fib (n-1)
looks like Haskell
looks like Haskell
fibr 0 a b = (a,b)
fibr n a b = fibr (n-1) (a+b) a
looks like Haskell