This is a bummer. I remember when I first tried out rust the repl was still a thing. As someone who writes mostly Haskell and Python, interactivity with a language is a huge plus. I hope that eventually another repl comes around.
Four years with Rust
151–160 of 199 posts
Re: Four years with Rust
#152Earlier quoted context omitted.
Can you talk more about using Pony in a production environment? What are the performance aspects of it? How do you find writing 'non-actor' code - like just doing some string manipulation? I find the language fascinating but I'm learning Erlang and I don't really want to get started with Pony at the same time. Do you have experience with Erlang? what made you choose Pony? Sorry for the bombardment of questions but I…
I've never met anyone else using Pony in production, so I'll try and give the best answer I can. > What made you choose Pony? We wanted a Type Safe language to run a REST API frontend. That is to say, we wanted to have something that could redirect requests to the appropriate servers, at scale, whilst maintaining Type Safety in the server itself. We got hit by so many issues from JSON's weak/absent typing causing run…
That's just weird. How much of an effort did you even put into it? Erlang may have ugly syntax but it's the simplest syntax of all popular languages and the cognitive load while writing is pretty much the lowest I've come across. The language itself is tiny. Or did yo mean you weren't used to a functional language and that was the cognitive overload?
Re: Four years with Rust
#153Wow, four years already. Maybe you can help settle this question I've had. I'm a rubyist (like you were/are, and wycats, and a bunch of rustaceans), and I think that sort of drove my interest in rust. But after 4-5 years of ruby the dynamism which initially was super cool, has grown a little frustrating and I long for a more sophisticated type system and a compile step, since frustrating bugs crop up from time to tim…
Re: Four years with Rust
#154Earlier quoted context omitted.
What does that look like in code? I was using c# so I did the dirty: T1 arg; var foo = arg as T2; if (foo != null) .... Also, how do we format code here?
In Rust, you'd define an `enum` of two types. enum Either { Type1(T1), Type2(T2), } let's say you get a value of type Either then you can match on them: match value { Type1(v) => func(v), Type2(v) => func2(v), }
function(T1 thing) {
//do normal T1 stuff here
var foo = arg as T2;
if (foo != null)
foo.T2Stuff();
//more normal T1 stuff
}
If I'm understanding your example I would have to wrap all the T1 stuff in a match.Re: Four years with Rust
#155I would appreciate if anyone can share your dev setup for Rust. I tried Rust and Racer long time ago and it's not a pleasant experience.
Re: Four years with Rust
#156Earlier quoted context omitted.
Rust doesn't have a GC in the first place, so there's nothing to turn on. Even then, the fundamental hurdle with GC isn't the effect on your program's runtime, it's the effect that it has on the lifetimes of your data . GC (and RC) are means of dynamic lifetime determination. Manual memory management is static lifetime determination. The latter requires you to structure your code in a specific way, which may be less…
I was just thinking that most languages are either GCed (like Java or Go) or manually curated (C/C++/rust). My idea is that if one could write in a language like Go (which has some kind of GC), but when one wants, say "I'll take care of this memory".
D has optional GC but their standard library is kind of fucked up.
Re: Four years with Rust
#157Earlier quoted context omitted.
I've never met anyone else using Pony in production, so I'll try and give the best answer I can. > What made you choose Pony? We wanted a Type Safe language to run a REST API frontend. That is to say, we wanted to have something that could redirect requests to the appropriate servers, at scale, whilst maintaining Type Safety in the server itself. We got hit by so many issues from JSON's weak/absent typing causing run…
> Erlang has this sort of huge cognitive overload with it's syntax, making it take longer to learn, for no obvious benefits. That's just weird. How much of an effort did you even put into it? Erlang may have ugly syntax but it's the simplest syntax of all popular languages and the cognitive load while writing is pretty much the lowest I've come across. The language itself is tiny. Or did yo mean you weren't used to a…
Erlang seems simple on the surface, but each type seems to have it's own DSL, allowing things that seem the same, to not be, which means you have to hold more context in your head.
e.g. Are these two the same?
ensure(A, B) ->
if A == B ->
Does -> always mean function? Or does it mean something similar to progn or begin from CL and Scheme? Or does it vary with context?I had issues teaching where to use ; or . or end, and having people actually comprehend the reasons enough to do it without thinking.
At least with Scheme it's always )
We also investigated using Elixir, which has less overhead, and more people find easier to get up and running with. However, at the time Mix wasn't stable yet, which counted it out.
Re: Four years with Rust
#158Rust as a language is now realizing the benefits of borrow checking. As the article points out, the syntax doesn't have to distinguish between move and assign. The borrow checker will catch a reuse of something already moved away. This turns out to be effective enough in practice that the syntax distinction isn't necessary. That wasn't obvious up front. Not having exceptions tends to generate workarounds which are ug…
> There's still too much that has to be done with unsafe code. But the unsafe situations are starting to form patterns. I think as long as those patterns can be abstracted out and moved into thoroughly-vetted libraries with a safe interface, unsafe code isn't really a problem. I expect that getting Rust's standard libraries to a place where regular applications very rarely need to create their own unsafe code blocks…
Reducing this unsafe surface area should result in outsized gains overall. I'm not familiar with the unsafe patterns, and to what extent they could be addressed/reduced through Rust language/compiler design, but that'd be one area where research focus might produce even more benefit.
The other weak point may be the LLVM itself, which I guess would be sort of a background hum of risk to Rust.
Outsider view: not sure of the relative levels of risk in each layer, and to what extent they can be addressed.
Can (or will) these unsafe patterns be capable of being addressed by future changes in Rust?
Re: Four years with Rust
#159Earlier quoted context omitted.
> Erlang has this sort of huge cognitive overload with it's syntax, making it take longer to learn, for no obvious benefits. That's just weird. How much of an effort did you even put into it? Erlang may have ugly syntax but it's the simplest syntax of all popular languages and the cognitive load while writing is pretty much the lowest I've come across. The language itself is tiny. Or did yo mean you weren't used to a…
I use Scheme extensively, which I would argue has the least syntax of the functional languages. Erlang seems simple on the surface, but each type seems to have it's own DSL, allowing things that seem the same, to not be, which means you have to hold more context in your head. e.g. Are these two the same? ensure(A, B) -> if A == B -> Does -> always mean function? Or does it mean something similar to progn or begin fro…
Re: Four years with Rust
#160Earlier quoted context omitted.
I've been using Rust to process fairly large amounts of streaming financial data. I am using Protocol Buffers (and evaluating Cap'n Proto) for network serialization and Kafka for buffering/queuing, and overall the library support is quite good. Previously I was using JVM languages for this purpose, but grew weary of the resource footprint, and especially the unpredictable GC pauses. I am aware of the Azul JVM which r…
What Rust libraries are you using for protobufs?