These are chat archives for rust-lang/rust

6th
Apr 2016
mhsjlw
@mhsjlw
Apr 06 2016 00:53
I'm on a search for a language that I really, really love. I've been writing nodejs and I love it. However, I'm looking for something new. I want to do more and I want to do things faster and more efficiently. I've tried elixir, Erlang and clojure but none of those languages really clicked with me. I want to give rust a try. Do you think that rust is a language worth learning for using it for practically anything while doing it quickly?
John Landahl
@jlandahl
Apr 06 2016 00:55
I'm only a lurker, so take this for what it's worth, but I would say yes -- with the understanding that you will have to think a lot about object ownership and lifetimes, in a way you haven't had to do in those other languages.
Jacob Moen
@jacmoe
Apr 06 2016 00:56
What you really, really love is highly subjective, naturally :smile:
Do you care about being in control? By being explicit ? Do you care about performance? Or is a pretty syntax more important than raw power?
((Although, I'd wager that Rust provides both))
mhsjlw
@mhsjlw
Apr 06 2016 00:58
@jacmoe I want to be in control. Performance is also very important to me. Even then though, I've seen rust's syntax, and it's nice :P
Jacob Moen
@jacmoe
Apr 06 2016 00:59
I am new to Rust, but I haven't been this excited about a language since I discovered Delphi in the late 90's ! :sparkles:
I am coming from C and C++ (after my Delphi encounter) ;)
John Landahl
@jlandahl
Apr 06 2016 01:00
@mhsjlw It may take some effort to transition to a non-garbage-collected language, but after that you get a lot of great features that you won't find in any other comparable language.
mhsjlw
@mhsjlw
Apr 06 2016 01:00
Rust sounds very promising
But can you really use it for anything?
I mean that in a way like, programming a fridge to programming a game server
Or writing a web server
John Landahl
@jlandahl
Apr 06 2016 01:02
Yes, it's one of the few that scales all the way down to OS development or device drivers and all the way up as far as you want to go.
Jacob Moen
@jacmoe
Apr 06 2016 01:02
From what I've seen, you can create games in Rust, servers, services, - I'd say pretty much anything. :)
And web programming too :)
mhsjlw
@mhsjlw
Apr 06 2016 01:03
This is exactly what I'm looking for, thank you for your opinions
Jacob Moen
@jacmoe
Apr 06 2016 01:03
You can bind to Node.js as well - like migrating one module at a time
mhsjlw
@mhsjlw
Apr 06 2016 01:03
I am going to look into learning rust. I'll be back :P
Jacob Moen
@jacmoe
Apr 06 2016 01:03
:+1:
mhsjlw
@mhsjlw
Apr 06 2016 01:03
@jacmoe I've written rust bindings in node before funny enough
OK, so one more question then: what resources do you recommend for getting started?
Jacob Moen
@jacmoe
Apr 06 2016 01:04
Ah, and then you were wondering if Rust could do everything else :)
Aside from the book and the playground?
mhsjlw
@mhsjlw
Apr 06 2016 01:06
I've started reading the rust book yes, just wondering if there is anything else that you guys recommend
Oh thanks :D
John Landahl
@jlandahl
Apr 06 2016 01:06
For perspective, I do Scala (and a bit of Haskell) for a living and I really appreciate Rust for being able to provide a lot of the power of those languages while being able to scale all the way down pretty much to bare metal.
I always wanted to try out Haskell and now I don't have to, because of Rust :p
mhsjlw
@mhsjlw
Apr 06 2016 01:08
Very nice! I'm liking the community so far too :D
John Landahl
@jlandahl
Apr 06 2016 01:08
Well, I wouldn't go that far :)
mhsjlw
@mhsjlw
Apr 06 2016 01:09
I mostly write functional JavaScript and ive written Erlang before, but that's about as close as I've gotten to functional Lang's
I hear that Haskell is crazy functional though
John Landahl
@jlandahl
Apr 06 2016 01:09
For one thing, Haskell's default-lazy data structures make some things possible with very little code that would be convoluted otherwise. But "laziness" has some disadvantages as well.
mhsjlw
@mhsjlw
Apr 06 2016 01:10
Right now, I've got my mind set on Rust ;)
Jacob Moen
@jacmoe
Apr 06 2016 01:10
Maybe I will give Haskell a try :) But - and I have tried ML, Lisp, etc - and have been in the C++ world a long time - so I think Rust is going to be much more practical :)
John Landahl
@jlandahl
Apr 06 2016 01:10
I agree, for many use cases.
Rust hits a really nice sweet spot.
mhsjlw
@mhsjlw
Apr 06 2016 01:15
Should I be sticking with stable builds or nightly builds?
Jacob Moen
@jacmoe
Apr 06 2016 01:16
I am using the beta channel because the Atom plugins I am using works with 1.8+
mhsjlw
@mhsjlw
Apr 06 2016 01:19
OK, thanks
Jacob Moen
@jacmoe
Apr 06 2016 01:19
The IntelliJ plugin wants that as well. I think it has to do with racer
John Landahl
@jlandahl
Apr 06 2016 01:21
Is that the Oxidize plugin?
I didn't know about the Oxidize plugin.
mhsjlw
@mhsjlw
Apr 06 2016 01:34
EMACs ftw
John Landahl
@jlandahl
Apr 06 2016 01:34
It's the only one that comes up in a search from within IntelliJ, but it doesn't look like it's being maintained.
mhsjlw
@mhsjlw
Apr 06 2016 01:35
I mean, "emacs is a great operating system, it just lacks a text editor "
Jacob Moen
@jacmoe
Apr 06 2016 01:35
:smile: I really, really tried to be productive in Emacs - I like it a lot.
John Landahl
@jlandahl
Apr 06 2016 01:35
Yeah, people love to say that, but its text editing is pretty much top notch.
Jacob Moen
@jacmoe
Apr 06 2016 01:35
It's just that I end up spending more time tweaking my emacs script than actually using it :)
John Landahl
@jlandahl
Apr 06 2016 01:36
I use Emacs and IntelliJ about equally. They have different strengths.
Jacob Moen
@jacmoe
Apr 06 2016 01:37
What I love about Emacs is that my fingers doesn't have to leave the home row
mhsjlw
@mhsjlw
Apr 06 2016 01:38
^^^^
agreed
John Landahl
@jlandahl
Apr 06 2016 01:39
Which is why I use Emacs key bindings in IntelliJ
Jacob Moen
@jacmoe
Apr 06 2016 01:43
Hmm - perhaps I should try emacs-plus for Atom .. ?
Jacob Moen
@jacmoe
Apr 06 2016 01:57
Atomic-emacs is great :smile:
Jeroen Bollen
@Binero
Apr 06 2016 02:07
Isn't cargo fetch supposed to get all dependencies so it doesn't need to connect to the internet after?
I run cargo fetch, and it doesn't do anything
Peter Atashian
@retep998
Apr 06 2016 02:35
@Binero Maybe they were already downloaded before
Jeroen Bollen
@Binero
Apr 06 2016 02:36
When I do cargo build it tries to update dependencies
Peter Atashian
@retep998
Apr 06 2016 02:36
Do you have a Cargo.lock?
Anachron
@Anachron
Apr 06 2016 06:27
Morning mateys!
axiao
@joostshao
Apr 06 2016 09:21
https://github.com/tagua-vm/tagua-vm have anyone compiled it ?
This message was deleted
source/vm/engine.rs:131:17: 131:45 error: mismatched types:
 expected `u64`,
    found `usize` [E0308]
source/vm/engine.rs:131                 engine_options_size as usize,
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/vm/engine.rs:131:17: 131:45 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
error: Could not compile `tagua-vm`.

To learn more, run the command again with --verbose.
i meet a problem like this above
axiao
@joostshao
Apr 06 2016 09:31
oh, i slove it , just the type
Erik Hedvall
@Ogeon
Apr 06 2016 09:31
Looks like it shouldn't be cast to usize after all.
hi, I'm trying to uncompress a tar.gz file ... I'm trying to use flate2 and tar for that.
code is here:
I'm trying to pass the flate2::gz::DecoderReader<std::fs::File> from flate2 into the tar library, but it later complains that
src/main.rs:72:25: 72:34 error: no method named `entries` found for type `tar::archive::Archive<flate2::gz::DecoderReader<std::fs::File>>` in the current scope
src/main.rs:72     for file in archive.entries().unwrap() {
                                       ^~~~~~~~~
src/main.rs:72:25: 72:34 note: the method `entries` exists but the following trait bounds were not satisfied: `flate2::gz::DecoderReader<std::fs::File> : std::io::Seek`
Vickenty Fesunov
@vickenty
Apr 06 2016 13:17
@soc it says that it cannot provide entries because it can't seek in the tar file, probably because it is gzip stream, and not a real file.
Erik Hedvall
@Ogeon
Apr 06 2016 13:18
The strange part is that the documentation doesn't show that it needs Seek
Jeroen Bollen
@Binero
Apr 06 2016 13:21
@retep998 I do have a Cargo.lock
Erik Hedvall
@Ogeon
Apr 06 2016 13:22
@soc You are using tar 0.4.4, right? It should only need Read: https://crates.fyi/crates/tar/0.4.4/struct.Archive.html
I have no idea why it would complain about Seek
@Ogeon thanks, I'm using 0.3 ... that was the version mentioned on the website ...
@vickenty I switched to using unpackwhich doesn't seem to require Seek
Erik Hedvall
@Ogeon
Apr 06 2016 13:32
The website may be outdated if they forgot to bump the version number. I would recommend trying with 0.4
ok, got it working
I wanted to change the methods from that weird procedure syntax to returning something, but I get errors: https://play.rust-lang.org/?gist=287ce8a697f0a61b39a22abf7b00eb9e&version=stable&backtrace=0
error: not all control paths return a value [E0269]
the example shows some if construct ... is this due to unwrap()?
Erik Hedvall
@Ogeon
Apr 06 2016 13:41
Just remove the ; from the last statement. That will turn it into a return expression
oh, jesus christ
who thought this would ever be a good idea?
I'm already super-cautious with procedures, and I still keep messing that up.
Erik Hedvall
@Ogeon
Apr 06 2016 13:42
whoever though this was a good idea: .map(|| String::new()) instead of .map(|| return String::new())
Anyway, that's how it is and you are free to use return instead
that seems the correct way, but unrelated to the issue at hand
Erik Hedvall
@Ogeon
Apr 06 2016 13:46
Well, the issue is that you are not returning anything
the whole semicolon thing is totally insane. :-)
Erik Hedvall
@Ogeon
Apr 06 2016 13:47
It's just odd, but it's very useful in cases like this:
right when people decided "hey, let's not do crazy things with ,, ., ;" and then Rust hit it outta the ballpark.
Erik Hedvall
@Ogeon
Apr 06 2016 13:49
...like this:
let x = if let Some(a) = maybe_a {
    a
} else {
    make_new_a()
};
return is mostly used for early function returns
where?
Erik Hedvall
@Ogeon
Apr 06 2016 13:51
The if returns a or the result of make_new_a() to x.
that seems to be a very very roundabout way of doing maybe_a.unwrap_or_else
Erik Hedvall
@Ogeon
Apr 06 2016 13:51
It's just a stupid example
sure, but how is that related. that's how it works in every modern language.
Erik Hedvall
@Ogeon
Apr 06 2016 13:52
Rust takes the same syntax and applies it to every kind of block, except loops
that isn't new either, but no language that has done this requires the gymnastics Rust requires.
first one has to re-learn to sprinkle semicolons all over the place, and then one has to be careful and remember the places where it shouldn't be added. :-)
the fn foo() { some_method(); } things feels like one of Scala's worst mistake reinvented.
Erik Hedvall
@Ogeon
Apr 06 2016 13:56
I wouldn't call the optional omission of ; instead of using return at the end of a function block gymnastics. As I wrote before, you are free to use return instead. It's not an error, just not idiomatic.
Christian Howe
@cjhowe7
Apr 06 2016 13:57
it's from the functional world
I wouldn't say that. functional languages managed to do without this "feature".
Christian Howe
@cjhowe7
Apr 06 2016 13:58
no they didn't
for example
name a language which associates semicolons with such rules
Christian Howe
@cjhowe7
Apr 06 2016 13:58
that's not the point
lol
take haskell
haskell certainly doesn't discard return values based on whether ; is there or not
Christian Howe
@cjhowe7
Apr 06 2016 13:59
lol give me a chance to get an example
ok, brb
Erik Hedvall
@Ogeon
Apr 06 2016 14:00
fn foo() { some_method(); } is sort of sugar for fn foo() -> () { some_method(); ()}. It's a ; separated list, where the last expression is the return value.
Christian Howe
@cjhowe7
Apr 06 2016 14:01
here, i'll just write some elm, it'll probably be compatible with haskell
foo x y =
  let x = x + 5 in x * y
the idea behind something like that is that the x * y is the return value
but there's no explicit return
or like, in rust, you might do
Francisco Fernández Castaño
@fcofdez
Apr 06 2016 14:01
because it's an expression
so it must compute "something"
even unit
like in the semicolon one
Christian Howe
@cjhowe7
Apr 06 2016 14:02
brb
sure, I last expression is the result value. nothing special about that. still doesn't explain the ; thing.
Rust's ; is like the language lawyering in C that , is not a ,, but a sequence point operator. nothing good has come out of it. :-)
Christian Howe
@cjhowe7
Apr 06 2016 15:04
i mean, the point is it's more relevant for functional uses where that might be the only expression
if you want to make returns explicit in your imperative functions, no one is stopping you
for pure lambdas, it's very useful
and it's very hard to misuse
I don't think anyone disagrees on that point.
Christian Howe
@cjhowe7
Apr 06 2016 15:06
i mean, if you're doing explicit returns, then it's not gonna matter if you forget the semicolon
and if you're not returning anything and you forget the semicolon, you'll just get a type error and have to add it
so i don't see why there'd be a problem with it
it really isn't a big deal to give semicolons different semantics, especially when it helps for some use cases
I think ascribing these semantic differences onto the ; is a feature no one ever asked for.
if you get it right, you still had to write the semicolons everywhere else, and if you don't you get an error message which doesn't even tell you what's wrong.
Christian Howe
@cjhowe7
Apr 06 2016 15:11
i just explained why it was useful, and you seemed to agree
and the error message should be a type error
also, if you think you're gonna learn a new language without knowing the semantics, you're gonna have a bad time
@cjhowe I'm not sure we agreed on that.
Christian Howe
@cjhowe7
Apr 06 2016 15:11
"I don't think anyone disagrees on that point."
yes.
Christian Howe
@cjhowe7
Apr 06 2016 15:13
so you seem to think that it's okay to have different semantics for semicolons in lambdas and functions, which is pretty bad considering that they're supposed to basically be the same thing
"more relevant for functional uses" -> yes; "explicit returns in imperative" -> who cares?
none of the desirable properties you described depend on Rust's choice of (ab)using ; that way.
Christian Howe
@cjhowe7
Apr 06 2016 15:16
you seem to have attached some connotations to the meaning of semicolons based on your previous experience with languages, and it frustrates you that rust doesn't conform to those connotations
i think that semicolons should be comments
I think my basic point is not that one doesn't need to learn the semantics, but that the ; is adding accidental complexity.
I think there is existing precedence for ; as comments.
It's just wasting people's time which could have been spent learning lifetimes or ownership rules.
Christian Howe
@cjhowe7
Apr 06 2016 15:20
i don't think it's wasting anyone's time
"not including a semicolon at the end means return" isn't really that complex
except when you forget it, or add it accidentally, because all the preceding lines had one.
Christian Howe
@cjhowe7
Apr 06 2016 15:20
then you should know what happens when you forget it
it'll probably be a type error
using the last expression as the result is not exactly a 2016's invention :-)
anyway, I really hope that someone writes an Elixir for Rust. Rust's technology is amazing, but the user interface is needlessly obtuse.
feels like the language is dragging 20 years of syntactical baggage around, despite existing for only 6 years ...
Christian Howe
@cjhowe7
Apr 06 2016 15:26
lol
static typing with message passing is research-tier i think
you could use like an enum i guess
not very dynamic though
elixir is really intended to be dynamic
just about everyone wants this though
sorry, "Elixir" was meant in the sense of "a language which adds nothing but a sane user interface to the base system"
not in the sense of I-want-Elixir-the-language
Christian Howe
@cjhowe7
Apr 06 2016 15:28
oh, you mean like, Elixir is to Erlang as X is to Rust
idk if that's necessary
yes, exactly.
Christian Howe
@cjhowe7
Apr 06 2016 15:29
the syntax isn't THAT bad
but you can be the person to go write rustcoffee or whatever and compile to rust
From my experience it's repeating too many mistakes. If that's enough for someone to step forward ... not sure.
Christian Howe
@cjhowe7
Apr 06 2016 15:29
i'm not so sure about that
too busy repairing other languages already :-)
Christian Howe
@cjhowe7
Apr 06 2016 15:30
that's the problem, you're basing your entire judgement based off of your experience
the rust people spent a lot of time thinking about stuff too
I remember that despaired comment from one of the scalac developers saying "I wished Rust devs looked at this language, so they wouldn't repeat our mistakes"
Christian Howe
@cjhowe7
Apr 06 2016 15:33
it's a very minor complaint
Scala devs will spend roughly three major releases to get away from the equivalent of Rust's procedure syntax + ; ... it's considered bad enough to pay 10 years of migration to get rid of it.
Christian Howe
@cjhowe7
Apr 06 2016 15:34
why do you hate semicolons so much
it's 2016?
Christian Howe
@cjhowe7
Apr 06 2016 15:35
do you type in colemak or something? it is kinda annoying to reach now
for qwerty people it seems like such a waste of a key to get rid of semicolon
i'd definitely want more semicolons if i typed qwerty
mandatory semicolons are obnoxious, but adding these kind of semantic differences as Rust does ... that's on a completely different level. :-)
Christian Howe
@cjhowe7
Apr 06 2016 15:36
it's another solution to the problem
instead of getting rid of them, give them more purpose
every other (functional) language was able to solve the problem without introducing Rust's ... "approach"
Jacob Moen
@jacmoe
Apr 06 2016 15:36
Only programmers can get heated up over such minute stuff - this conversation is epic :smile:
@jacmoe :-)
Christian Howe
@cjhowe7
Apr 06 2016 15:37
i mean
a pure functional language without side effects by definition doesn't need them
regarding your earlier comment: I don't hate semicolons, I just don't want to write or think about them. Semicolon inference + letting the IDE show them half-transparently ... that's combining the benefits of both, imho.
Christian Howe
@cjhowe7
Apr 06 2016 15:46
that's debatable
semicolon inference like JS sometimes forces you to think about them more
Regis Boudinot
@selfup
Apr 06 2016 15:47
Well not using a semicolon is an explicit return. So semicolons do have their uses. They return (). They are not required in ES6, so Javascript might be your thing :smile: I do agree however, especially coming from ruby/es6/python but all languages have their quirks
@cjhowe I think that's a huge strawman.
"semicolon inference like JS" ... I think no sane person would have JS in mind when he/she think about good semicolon inference.
Christian Howe
@cjhowe7
Apr 06 2016 15:48
what you want isn't semicolon inference, you want expressions to be unambiguous without semicolons
Jacob Moen
@jacmoe
Apr 06 2016 15:48
Golang also does not use semicolons - last time I checked.
Christian Howe
@cjhowe7
Apr 06 2016 15:48
haskell uses line endings for that sometimes
which is worse IMO
Regis Boudinot
@selfup
Apr 06 2016 15:48
Never use em in JS. Babel takes care of that for me haha. Correct Go is nice about that
although it's kind of interesting that so many JS developers believe that semicolon inference is a hard thing to do.
Jacob Moen
@jacmoe
Apr 06 2016 15:49
Coming from C and C++ I like semicolons
And I like that Rust treats it a bit differently.
@jacmoe everyone likes his/her grandma. that doesn't mean she has to be part of everyday llife. :-)
Christian Howe
@cjhowe7
Apr 06 2016 15:50
do you think if you came to rust as your first language, you'd care at all?
Yes, I do care.
Jacob Moen
@jacmoe
Apr 06 2016 15:51
I would not choose Rust as my first language, if I were me. :)
Can't you write a compiler plugin @soc ?
other language also take that into account: "is this something important, or is this just making beginner's lives harder?"
(point in case: Procedure syntax in Scala was removed because it was a pointless distinction which wasted 5 minutes of everyone's time while learning the language.)
(no "but but, you only have to learn it once, and then you remember it!!!")
Christian Howe
@cjhowe7
Apr 06 2016 15:53
i don't like scala
why not just use clojure
@jacmoe depends on the positions where the plugin can hook into.
Christian Howe
@cjhowe7
Apr 06 2016 15:54
you really like scala
@cjhowe types, performance, tooling, libraries, backends
Christian Howe
@cjhowe7
Apr 06 2016 15:54
it's all JVM
Jacob Moen
@jacmoe
Apr 06 2016 15:54
What I really like about Rust is that it does not sugar coat things. It is not targeted at beginner programmers. It is a totally honest (and awesome) programming language.
+ JavaScript (+ upcoming LLVM)
@cjhowe it's the language I'm spending a lot of time with. It's certainly not perfect, but what I like is the no-excuses approach: if something sucks, you fix it.
Christian Howe
@cjhowe7
Apr 06 2016 15:55
i really don't think it sucks
i don't want to type return all the time in my lambdas
me, too. but that was never the point right?
Christian Howe
@cjhowe7
Apr 06 2016 15:56
why not?
not sure I understand what you are referring to...
Christian Howe
@cjhowe7
Apr 06 2016 15:57
why can't the point of having these semicolon semantics not be to make pure lambdas not require returns or semicolons?
because that's not the point?
the one doesn't follow from the other
Christian Howe
@cjhowe7
Apr 06 2016 15:57
lol
|x| x + 5 works because i didn't include the semicolon, so it returns x+5
and?
Christian Howe
@cjhowe7
Apr 06 2016 15:59
if we didn't have any semicolons, how would it know whether to return () or x + 5?
in haskell it would be like
\x -> do
  someSideEffects
  return x + 5
or something
the language can decide either by discarding it explicitly (; is not eplicit), or by infering it from the target.
I think both options make more sense than what exists now.
Christian Howe
@cjhowe7
Apr 06 2016 16:00
inferring it? from what?
it doesn't include a type
and if you assign it to a local and don't use that local, it'd have no context whatsoever
if the target expects a number, it can't return ()
Christian Howe
@cjhowe7
Apr 06 2016 16:02
you're adding context that isn't there
really, it's not magic. languages did it for decades.
Christian Howe
@cjhowe7
Apr 06 2016 16:02
no language inferred things without context
because there is nothing to infer.
why would () be in the set of valid return types?
Christian Howe
@cjhowe7
Apr 06 2016 16:03
because it can be? lol
for example
|x| println!("lol {}", x)
Christian Howe
@cjhowe7
Apr 06 2016 16:04
that returns ()
yes?
Jacob Moen
@jacmoe
Apr 06 2016 16:05
I don't like white space sensitive languages much so semicolons and braces all the way!
Christian Howe
@cjhowe7
Apr 06 2016 16:06
that thing probably adds semantics to whitespace
in this case that might be like haskell, where newlines have semantics
that's really not better at all
just vanity
Jacob Moen
@jacmoe
Apr 06 2016 16:07
:+1:
Regis Boudinot
@selfup
Apr 06 2016 16:07
Is this just a test or something?
@cjhowe I'm not sure what the example is trying to demonstrate ... () is println!s return type, therefore () is a valid return type of the expression
I'm not sure how you argue that for |x| x + 5 both x+5 and () would need to be considered.
Christian Howe
@cjhowe7
Apr 06 2016 16:10
@selfup yes
(except when + returns () which is probably unlikely) :-)
Christian Howe
@cjhowe7
Apr 06 2016 16:10
i'm not saying that
i have to think of an example, but i'm working too
Regis Boudinot
@selfup
Apr 06 2016 16:12
@cjhowe :clap:
btw, what's the recommended way in Rust to parse arguments?
Jacob Moen
@jacmoe
Apr 06 2016 16:17
clap is good - or so I've heard :)
also found pirate, getopts and argparse
Pirate - arr - makes sense :p
docopt seems to be the most popular one
nope nope nope nope nope ... I'll use clap.
Christian Howe
@cjhowe7
Apr 06 2016 16:32
so like
with these semantics, the last expression HAS to return a value
|x| println!("Hi! {}", x) x + 5 would have to return an int
which is fine for that case
but like
now if you want a void function
you'd have to do something like this |x| x = x + 5 ()
so you lose semicolons, sure, but now you're writing () to make functions void
and this is all assuming the syntax was unambiguous
Richard de Wit
@richarddewit
Apr 06 2016 19:14
Question: why should I take Rust over Go?
Christian Howe
@cjhowe7
Apr 06 2016 19:14
go has a garbage collector
go channels aren't as safe as they seem
Jacob Moen
@jacmoe
Apr 06 2016 19:38
@richarddewit You would choose Rust over Go if you are interested in inter-operating with C - and thus other languages. It is encouraged by the Rust community. Cgo, on the other hand, is something that is undesirable because of the overhead.
Choose whatever makes you happy. Or even choose both. Go is stronger in web dev than Rust, but that might change.
Christian Howe
@cjhowe7
Apr 06 2016 19:40
do wat u wanna do
Jacob Moen
@jacmoe
Apr 06 2016 19:41
Take it for a test drive. You might end up loving it. Or you might hate it. :smile:
Christian Howe
@cjhowe7
Apr 06 2016 20:10
anyways it really depends on what you're doing
rust is great for gamedev stuff
for web servers, you might have better luck with go
if you're looking at go you should probably also be looking at clojure and elixir
depending on your websites workload, one of those might be a better option
if you're doing realtime, definitely check out elixir
clojure is just all-around better than go for web dev imo, especially since you can use it client side
some people like scala because they're wrong :smiling_imp:
mhsjlw
@mhsjlw
Apr 06 2016 20:15
i've used both elixir and clojure, and i can say that clojure is much nicer for web dev
@cjhowe I think the philosophy of Rust and Scala are closer than you think :-)
Christian Howe
@cjhowe7
Apr 06 2016 20:15
anything JVM already puts it out of competition with Rust IMO
they spend their complexity budget on different things, but the way they spend it is quite similar
Christian Howe
@cjhowe7
Apr 06 2016 20:16
you can't really use Scala for systems and gamedev though
gamedev on the JVM is scary
Rust is more about zero-cost abstraction for running code, Scala is more about zero-cost abstractions for writing code
yeah, they don't have the same niche.
both things are valuable in the right situation
Christian Howe
@cjhowe7
Apr 06 2016 20:17
Scala does compete with Clojure and Elixir though
i wouldn't choose scala over either of those things
you get macros in both of those
and honestly you can't beat clojure macros
I think Scala's macros are way better.
compile-time check all the things :-)
Christian Howe
@cjhowe7
Apr 06 2016 20:18
you're probably not a lisper
do you even emacs bro?
lol
ah, who cares about compile-time checking
if i want that i can use rust
for that stuff
but for like websites, i don't care even in the slightest
and like, when it comes to compile-time checking
Elm absolutely destroys scala
@cjhowe Scala is a (bit) more expressive when it comes to macros and type systems compared to rust
Christian Howe
@cjhowe7
Apr 06 2016 20:20
i like elixir because they don't give a shit about types
functional > types
types are for statically compiling things
I like Io, it's like lua, but even more barebone
Christian Howe
@cjhowe7
Apr 06 2016 20:20
i've messed with Io, it's alright
but all of them, elm, elixir, Io lack a lot of the ecosystem
Christian Howe
@cjhowe7
Apr 06 2016 20:20
write it yourself
so if you don't want to roll everything your own ...
^^ yeah, depends on whether you're in the business of getting things done, or writing stuff for fun :-)
Christian Howe
@cjhowe7
Apr 06 2016 20:21
i can do both
more power to you then
Christian Howe
@cjhowe7
Apr 06 2016 20:21
i think anyone who wants to get things done and not have fun has a seriously broken philosophy of life
or maybe just doesn't like programming
some people have fun shipping things that make an impact, not roll their own ecosystem
Christian Howe
@cjhowe7
Apr 06 2016 20:22
you don't have to build a whole ecosystem to use clojure
lol
or elixir either
Richard de Wit
@richarddewit
Apr 06 2016 20:23
I wanted to learn a new language. One that is fast, catches errors on compile and can do "scripting"
Christian Howe
@cjhowe7
Apr 06 2016 20:23
elixir has a LOT of stuff that scala has
@richarddewit if you don't mean rust, check out haskell
Richard de Wit
@richarddewit
Apr 06 2016 20:23
As well as create a backend for rest app etc
@richarddewit then Scala is also an option! @cjhowe :-P
Richard de Wit
@richarddewit
Apr 06 2016 20:24
API , stupid phone
Christian Howe
@cjhowe7
Apr 06 2016 20:24
haskell will give you way more experience
if you're just learning it for fun, it makes you better at every other language
@soc i will say that scala has pretty good android stuff
Jacob Moen
@jacmoe
Apr 06 2016 20:24
Bah, Lisp all the way! Haskell is tyranny :smile:
@cjhowe I think the Android stuff needs a lot of documentation, but works fine. Scala.js though ... that's pretty amazing.
Richard de Wit
@richarddewit
Apr 06 2016 20:25
Lisp x Haskell = Clojure?
Christian Howe
@cjhowe7
Apr 06 2016 20:25
not quite, clojure isn't nearly as statically typed as haskell
for example, you still have nulls in clojure
@soc clojure did it first
what?
Christian Howe
@cjhowe7
Apr 06 2016 20:27
also if you have a choice between a lisp and a non-lisp, always choose the lisp
Richard de Wit
@richarddewit
Apr 06 2016 20:27
I'm a Python/JS guy, I don't know what types are :P
Christian Howe
@cjhowe7
Apr 06 2016 20:27
clojurescript came before scala.js
Jacob Moen
@jacmoe
Apr 06 2016 20:27
@cjhowe You beat me to it :smile: Yes, that's what I meant.
mhsjlw
@mhsjlw
Apr 06 2016 20:27
elm lol
@cjhowe yeah, but who cares what came first?
Christian Howe
@cjhowe7
Apr 06 2016 20:27
no one, it was mostly a joke
@soc object orientation sucks
I think what matters is tooling, IDE support, libraries, ...
Jacob Moen
@jacmoe
Apr 06 2016 20:28
http://landoflisp.com/ - the comic about Land of Lisp and Haskell is at the bottom - great read ;)
Christian Howe
@cjhowe7
Apr 06 2016 20:28
emacs is better than an IDE
@cjhowe yeah, that seems a popular opinion these days
Christian Howe
@cjhowe7
Apr 06 2016 20:28
and you can't beat paredit
Richard de Wit
@richarddewit
Apr 06 2016 20:28
Spacemacs :)
soc @soc kids these days
Jacob Moen
@jacmoe
Apr 06 2016 20:28
Atomic-emacs !
Christian Howe
@cjhowe7
Apr 06 2016 20:29
spacemacs is hilarious, i actually met someone who uses it
i was converted way before spacemacs
Scala IDE support = rekt
also clojure has an insane amount of libraries
Jacob Moen
@jacmoe
Apr 06 2016 20:30
Emacsrocks literally rocks.
IDE support for Scala is pretty great these days with Eclipse, IntelliJ, Emacs, Vim, Sublime, Atom, ...
Christian Howe
@cjhowe7
Apr 06 2016 20:30
dynamically typed languages are pretty limited when it comes to IDE support.
Christian Howe
@cjhowe7
Apr 06 2016 20:31
again, functional >>>>>> types
my emacs clojure has autocomplete if that's what you mean
I don't think these two exclude each other.
Christian Howe
@cjhowe7
Apr 06 2016 20:31
no, they don't
but clojure has some really powerful functional tools
of course there are heuristics, but if you don't litter your clojure code with core.typed, it's limited in power
sure, agree on that.
Christian Howe
@cjhowe7
Apr 06 2016 20:32
idk about that
you don't need typed stuff that badly
types prevent you from making mistakes
sometimes it's alright to just not make those mistakes
with a statically typed language, all editors and IDEs can ask the compiler for information. with dynamically typed languages ... even the compiler doesn't really know
Christian Howe
@cjhowe7
Apr 06 2016 20:33
and to be fair, scala isn't really that statically typed
look at haskell, it's pretty intense in terms of statically typing stuff
in what sense?
Christian Howe
@cjhowe7
Apr 06 2016 20:33
oooh, this is a good one
@soc you can kinda get around stuff with reflection with anything on the JVM
I think Scala has a few more escape hatches than Haskell, but apart from that ... really depends on which Haskell you mean.
Christian Howe
@cjhowe7
Apr 06 2016 20:34
the point is, scala isn't perfectly typed
and types don't prevent logic errors in Scala's form
idris is getting there, but it's really not there yet
sure, most things aren't, even Haskell or Idris.
Christian Howe
@cjhowe7
Apr 06 2016 20:35
yeah, but scala is definitely closer to java on that scale
it's just a nice local optimum, like maybe ML, Idris, or others.
Christian Howe
@cjhowe7
Apr 06 2016 20:35
that's completely subjective
you can still mutate variables in scala
i think that's a WAY bigger problem
yeah, some people also don't like ML ... of course it's subjective.
Christian Howe
@cjhowe7
Apr 06 2016 20:36
in clojure you have a step closer to functional without losing that
which is gonna be like, atoms and stuff in clojure
immutability != functional
Christian Howe
@cjhowe7
Apr 06 2016 20:37
immutability != pure functional
probably, but even Rust shows that other approaches are also interesting.
Christian Howe
@cjhowe7
Apr 06 2016 20:37
you can have immutability without it being pure
so really, it boils down to, how you weigh purely functional vs types
which is fairly subjective
Richard de Wit
@richarddewit
Apr 06 2016 20:38
So my question kinda was if I could replace Python with Rust entirely. cli programs and Django replacement. Or should I use something else?
yeah, I like both. :-)
Christian Howe
@cjhowe7
Apr 06 2016 20:38
then use haskell
or idris
that's my point
scala isn't both
Idris is not really ready, and Haskell has huge practical issues.
like typeclass instances not being unique and stuff. the whole modularity part of the language just doesn't exist.
Christian Howe
@cjhowe7
Apr 06 2016 20:39
clojure isn't both either, but it does have more functional stuff and less type stuff
and if you think functional is more important, that's worth it
I wouldn't say Clojure is more functional than Scala, if you take "Haskell" as your perfect functional language.
will be interesting if Haskell's backpack ever gets of the ground. Ocaml is also doing some interesting stuff with modular implicits. And maybe ML will get some new life, too. Exciting times.
Christian Howe
@cjhowe7
Apr 06 2016 20:42
you also get homoiconicity with clojure, which is great because paredit and macros and stuff
i think it is more functional, you have logic programming stuff, the whole clojure metaphysics thing
again if you don't value those things over the stuff you get in scala, and if you don't hate OO, you probably thing differently
Scala does logic programming at compile time :-P
Christian Howe
@cjhowe7
Apr 06 2016 20:46
(def lisp (the-one-true 'syntax))
plus context bounds, typeclasses, higher-kinded-types, type-level programming, macros, good module system, one of the best OO systems ... that's a nice package in my book.
Christian Howe
@cjhowe7
Apr 06 2016 20:47
best OO system < no OO system
you think of your own opinion waaaaay too highly
huh?
so educate me, if you feel the need to make that judgment.
Christian Howe
@cjhowe7
Apr 06 2016 20:52
if you want to go around saying types are the greatest thing, you should write elm for 3 months
feel my pain
mhsjlw
@mhsjlw
Apr 06 2016 20:53
why do people write elm LOL
Christian Howe
@cjhowe7
Apr 06 2016 20:53
@soc you state some of your opinions as fact
I like elm, but it's young and has a small community. so expect rough edges?
mhsjlw
@mhsjlw
Apr 06 2016 20:53
im not making fun of elm, sorry. im just joking around
Christian Howe
@cjhowe7
Apr 06 2016 20:54
@mhsjlw i am a masochist. the pain is all pleasure. when i spend hours just typing the same thing over and over, and the agony flows through my vains, it feels very good
I thought it would be clear that I'm only speaking in personal capacity. but feel free to give me a hint were this wasn't clear!
Christian Howe
@cjhowe7
Apr 06 2016 20:54
rough edges is an understatement
just give me a link
Christian Howe
@cjhowe7
Apr 06 2016 20:56
if it was something specific you said, i would have at first
no problem, just link to it
Christian Howe
@cjhowe7
Apr 06 2016 20:56
it's just the vibe i've gotten from our conversations today
mhsjlw
@mhsjlw
Apr 06 2016 20:56
@cjhowe ... i've heard elm programmers love side effects
https://twitter.com/jfcloutier/status/710082802608316416
Christian Howe
@cjhowe7
Apr 06 2016 20:56
it's FRP
mhsjlw
@mhsjlw
Apr 06 2016 20:57
'Elm programmers respect side effects.'
Christian Howe
@cjhowe7
Apr 06 2016 20:57
you have to have side effects to make anything useful
but it's kinda like, you're codifying those effects into an object
and someone else runs it
mhsjlw
@mhsjlw
Apr 06 2016 20:57
i've written functional langs before, i know. i just think that image is funny
Christian Howe
@cjhowe7
Apr 06 2016 20:58
we even have an Effects thing
and then I decided that wasn't enough, so I made my own object to codify queries to the component tree and stuff
and also for like, generating ID's and stuff
cengizIO @cengizIO enjoys constructive conversation..
mhsjlw
@mhsjlw
Apr 06 2016 21:02
ha
Christian Howe
@cjhowe7
Apr 06 2016 21:05

I think ascribing these semantic differences onto the ; is a feature no one ever asked for.

this is implying stuff about what other people think without evidence

From my experience it's repeating too many mistakes. If that's enough for someone to step forward ... not sure.

this implies that your experience and opinions should be enough for other people to act

@soc ^that's the type of stuff i mean
that's why i got that vibe, to be more specific

just as a thought experiment for you – switch our names in the debate today and read it again. I'm pretty sure you will be adding tons of exclamation marks to

you think of your own opinion waaaaay too highly

Christian Howe
@cjhowe7
Apr 06 2016 21:07
i think i've said multiple times i'm just arguing that it's subjective based on how you value things
and I pointed to existing evidence, namely existing languages which all came to a different conclusion. (if we focus on this feature for a moment.)
Christian Howe
@cjhowe7
Apr 06 2016 21:08
on semicolons?
Jacob Moen
@jacmoe
Apr 06 2016 21:09
:smile: :clap: :sparkles:
Christian Howe
@cjhowe7
Apr 06 2016 21:09
lol
so if you don't want to imply everyone else in the last few decades was stupid, subjective feelings should come with a bit of substance.
Jacob Moen
@jacmoe
Apr 06 2016 21:09
It is just programming languages, for Christ sakes.
Rust is highly influenced by ML and Haskell and C
and there is nothing you can do about it :p
@jacmoe and all of them managed to do without the named feature. :-)
Christian Howe
@cjhowe7
Apr 06 2016 21:11
my point is that no one else cares about the semicolon thing
not here anyways
Jacob Moen
@jacmoe
Apr 06 2016 21:11
@soc I am not going to bite :smile:
Christian Howe
@cjhowe7
Apr 06 2016 21:11
@jacmoe you have me for that
cjhowe7 @cjhowe always takes the bait
Jacob Moen
@jacmoe
Apr 06 2016 21:12
I actually like semicolons
Christian Howe
@cjhowe7
Apr 06 2016 21:13
@soc anyways, if no one else using rust seems to care about the semicolon thing, and you think it's outrageous that anyone could suggest such a thing, that's where i think you value your opinion too highly
not saying that you're necessarily wrong because of that; that would be the fallacy i just linked
Jacob Moen
@jacmoe
Apr 06 2016 21:13
I am also one of those weird types who loves the parens of Lisp .. :worried:
Christian Howe
@cjhowe7
Apr 06 2016 21:13
i do think that in that situation it's important to maintain an open mind
@jacmoe :beers:
isn't that selection bias?
people who think that Go's error handling is ridiculous probably also don't adopt Go/identify as members of the Go community. :-)
Christian Howe
@cjhowe7
Apr 06 2016 21:14
that's not true at all
because jobs
if i have to do go at work, i'd much rather do it than C#
i mean, i'm doing elm, and you've seen how willing i am to talk badly about it
and i suggested that we do elm!
so i don't think that's necessarily true at all
of course elm is young and i have hope that my problems will be addressed soon
but i think rust has been very welcoming to new ideas as well
Jacob Moen
@jacmoe
Apr 06 2016 21:19
The Rust community is great! The language is still at the honey moon phase and a lot of new things are happening and people are excited.
For good reason. ;)
Christian Howe
@cjhowe7
Apr 06 2016 21:19
somewhat like elm, but not nearly as bad
see, i'm willing to throw myself into the same problems
i have no shame
Jacob Moen
@jacmoe
Apr 06 2016 21:23
Elm .. interesting. Nothing useful to be read at their main site, except a lot of fluffy talk about how great it is.
Is it an OCaml derivative?
Christian Howe
@cjhowe7
Apr 06 2016 21:24
the FRP stuff it's based on is amazing
yeah, basically
more like Haskell
but that's an OCaml derivative so
Jacob Moen
@jacmoe
Apr 06 2016 21:24
I saw some Cabal files at their Github - do they have technical docs describing the arcitecture?
Christian Howe
@cjhowe7
Apr 06 2016 21:24
yeah
the hellodatamvc for elm is very good
it's just that once you get to building real, multipage apps, things start to break down
Jacob Moen
@jacmoe
Apr 06 2016 21:26
Elm is an alternative (much better by the look of it) to RoR and Node.js/whatever.js then?
Christian Howe
@cjhowe7
Apr 06 2016 21:27
no it's client side
maybe an alternative to like React or something
Jacob Moen
@jacmoe
Apr 06 2016 21:27
So the backend could be anything, even Rust?
Christian Howe
@cjhowe7
Apr 06 2016 21:27
yes
lots of people like Elixir backends with Elm
Jacob Moen
@jacmoe
Apr 06 2016 21:28
Cool. :)
Christian Howe
@cjhowe7
Apr 06 2016 21:28
i think my company is gonna end up doing that
i'd still prefer clojure for everything, but i learned clojure after we started this, lol
honestly i'm not sure anyone has done as much elm as i have
i'm basically in unmarked territories
Jacob Moen
@jacmoe
Apr 06 2016 21:33
4 years old - that is not a lot for a language. inspired by Rust too.
Christian Howe
@cjhowe7
Apr 06 2016 21:35
the problem is there aren't enough people actually using it for their entire frontend application
a lot of people just use it for pieces of their website
and it can't improve without that feedback
hopefully i can help with that
Jacob Moen
@jacmoe
Apr 06 2016 21:47
It is a language that generates html, css and js from pure functional code. That sounds intriguing.
And fairly extreme :smile:
Christian Howe
@cjhowe7
Apr 06 2016 21:48
basically?
not really CSS
but you can if you don't want media queries
Jacob Moen
@jacmoe
Apr 06 2016 21:50
I know nothing about it. Just reading articles about it - it does sound really great.
Christian Howe
@cjhowe7
Apr 06 2016 21:51
well i'm gonna be writing an article about it soon
once i'm done with this project
it'll probably be pretty intense
Jacob Moen
@jacmoe
Apr 06 2016 21:55
Post a link to it when it's done. :=)
Christian Howe
@cjhowe7
Apr 06 2016 21:56
sure