|
Look Around You posted:Yeah I'm basically retarded and thought things through like not at all and ended up making an rear end out of myself posting like an idiot at 2 am. it's ok I do that too thing is it pretty much the norm to go into a new thing looking for reasons to hate it.
|
# ? Jan 28, 2012 14:24 |
|
|
# ? May 14, 2024 00:38 |
|
Look Around You posted:Yeah I'm basically retarded and thought things through like not at all and ended up making an rear end out of myself posting like an idiot at 2 am. Don't feel too bad, shrughes is basically a jerk. It's kind of his thing.
|
# ? Jan 29, 2012 02:59 |
|
Scaramouche posted:Don't feel too bad, shrughes is basically a jerk. It's kind of his thing. Yeah, but rust legitimately owns, often for exactly the reasons that were criticized. (Immutable variables own).
|
# ? Jan 29, 2012 03:12 |
|
Scaramouche posted:Don't feel too bad, shrughes is basically a jerk. It's kind of his thing. You say that like it's not pretty much everyone's thing here .
|
# ? Jan 29, 2012 03:12 |
|
The1ManMoshPit posted:Somebody's never included <Windows.h> and had to deal with nonsense error messages while trying to compile calls to std::max and std::min, or while trying to declare enum Distance { NEAR, FAR }; only to find they have been boned by all the windows #defines. Xlib has the same thing. It has #define None 0, which breaks LLVM and Qt and countless other things which do: code:
|
# ? Jan 29, 2012 03:58 |
|
Scaramouche posted:Don't feel too bad, shrughes is basically a jerk. It's kind of his thing. I don't feel bad really (and I don't hold it against him), I just feel dumb because I posted a kneejerk reaction of something without taking much time to figure out reasons behind it. Maybe part of it was I wasn't able to get a feel for the goals and stuff of the language right away, but that's not really an excuse for me posting retarded poo poo, that's just me not taking the time to comprehend something and then spouting poo poo off about ideas that I only half understood.
|
# ? Jan 29, 2012 06:05 |
|
There are a lot of interesting ideas in Rust. That's what you would hope to see from an acknowledged research project. It's hard to criticize anything about it, because they haven't really committed to anything about it, and might not for many years to come. I might point out that this also doubles as a reason not to get unduly unexcited about it, but after all, this is the internet.
|
# ? Jan 29, 2012 06:23 |
|
Look Around You posted:I don't feel bad really (and I don't hold it against him), I just feel dumb because I posted a kneejerk reaction of something without taking much time to figure out reasons behind it. Maybe part of it was I wasn't able to get a feel for the goals and stuff of the language right away, but that's not really an excuse for me posting retarded poo poo, that's just me not taking the time to comprehend something and then spouting poo poo off about ideas that I only half understood. I think your core argument was "this language looks like C++, Perl and LISP hosed and C++ drank throughout the pregnancy." It might've looked better if the dude who was writing code for the standard libraries used variables that were longer than two characters and maybe threw in some whitespace, but yeah, that is some ugly code.
|
# ? Jan 29, 2012 15:10 |
|
shrughes posted:Advanced programming languages are advanced. All these features are reasonable. quote:
quote:
quote:
quote:
That is the sound this question made as it flew over your head. Why should the consumer of fmt have to know about what type system features had to be worked around in order to declare it? quote:
quote:
quote:
|
# ? Jan 30, 2012 14:35 |
|
Whenever I see ~/fn~ I think It's so unique
|
# ? Jan 30, 2012 15:16 |
|
While I'm disappointed that I ran out of money before completing college, and that I'm now stuck eternally in service industry hell, I was never a great programmer. It's nice to be able to look at this thread occasionally and feel better that some of you might be alive today because you never had to encounter or attempt to fix my code. A good example was a short in-class project where we had to write some simple code in the fewest lines possible. I beat the instructor's ~30-line example by something like six lines... by concatenating as many variable definitions as I knew how and using a loop iterator variable as data AND in a separate break condition within the loop. This was in freshman year, and pretty much set the tone of my programming since. Shady Amish Terror fucked around with this message at 16:40 on Jan 30, 2012 |
# ? Jan 30, 2012 16:36 |
|
Shady Amish Terror posted:A good example was a short in-class project where we had to write some simple code in the fewest lines possible. I beat the instructor's ~30-line example by something like six lines... by concatenating as many variable definitions as I knew how and using a loop iterator variable as data AND in a separate break condition within the loop. This was in freshman year, and pretty much set the tone of my programming since. These sorts of challenges are fun and give a clear definition of the goal to enable competitiveness. It's a great thing to clear your mind with after spending six hours staring into the abyss wondering why the hell these backtraces don't make any goddamn sense what the hell gdb what is wrong with you. Of course, the trouble happens when some confuse work with play.
|
# ? Jan 30, 2012 17:34 |
|
Zombywuf posted:So you get wildly different behaviour from a fleck of fly poo poo in your code? Different things though look different. If you want your function to return nil put a special return nil keyword at the end of it, not ;. ; at the end of a line has a meaning in a huge number of languages, using the same syntax to make a thing that looks like it fulfils the same function but actually does something different is a very bad thing. What's next, + and - being defined as the malloc and free operators? you can explicitly return nil if you want (ret () quote:That syntax appears to declare the type twice on the same line. Why is the type declared twice on the same line? there's no type coercion between integer types in rust, 5u != 5. nor does uint == uint8, uint16 or uint32. quote:What is the type of ()? nil. quote:Why is failing to compile with a type error not an option? because patterns are not required to be exhaustive. this is like asking why asserts can't be staticaly checked.
|
# ? Jan 30, 2012 20:21 |
|
All this talk got me to check out rust. It actually looks pretty cool and I am trying to hold off judgement on things like ~/fn~. It seems silly to say "That isn't what I'm used to" or "That looks weird/awkward" without giving myself a chance to try it in practice. I'm excited about getting some rust code to run on a microcontroller, but so far I have only built x86 executables. I was glad to see C linking info right in the tutorial and I'm hoping the LLVM backend means it won't be to hard to get Thumb output (I've only used gnu tools to target ARM in the past).
|
# ? Jan 30, 2012 23:03 |
|
the talent deficit posted:you can explicitly return nil if you want (ret () quote:there's no type coercion between integer types in rust, 5u != 5. nor does uint == uint8, uint16 or uint32. quote:nil. quote:because patterns are not required to be exhaustive. this is like asking why asserts can't be staticaly checked.
|
# ? Jan 30, 2012 23:54 |
|
Zombywuf posted:So why can the type of the variable being assigned to be inferred? it's inferred from usage. globals are accessible from outside the compilation scope, and must be explicitly defined quote:That I think wins the thread for most tautologist answer. you're going to have to explain how a compiler can infer whether input will lie in a specified domain
|
# ? Jan 31, 2012 00:54 |
|
Zombywuf posted:What you're saying here is that ; is a synonym for ret ();. This has a pleasing symmetry but has no place in a language. The semicolon's not a synonym; it's the empty statement afterwards that's a synonym for ret (). The semicolon's just acting as a Pascal-style statement separator rather than a C-style statement terminator. For a language which doesn't require semicolons as terminators, it's a lot more sensible to treat them as separators when they are used.
|
# ? Jan 31, 2012 01:32 |
|
Zombywuf posted:I'd heard some good things about rust, but these complaints are all perfectly reasonable. These "features" are terrible. Also your markup of the parent post is terrible. You are terrible. We're all terrible. Rust is 0.1 - much of the effort put into it is to see if certain language features can work together to build robust code. The syntax especially is being worked out as they write more and more code in it - the language has changed considerably (from what I have noticed) as they have gotten to the fully bootstrapped stage. If you want to talk about issues in the language, the developers are fairly active on irc and answered a whole bunch of my stupid questions eventually - they will probably be more qualified to answer your questions than anyone here. quote:So you get wildly different behaviour from a fleck of fly poo poo in your code? I can't justify the whole {foo;} {foo} thing. I find that weird. quote:That syntax appears to declare the type twice on the same line. Why is the type declared twice on the same line? As for 5u - I would imagine that type inference would let you drop the variable type and infer it from the literal type. I am guessing that the example is more explicit on purpose. quote:Why should the consumer of fmt have to know about what type system features had to be worked around in order to declare it? As for why 'fmt' can't look like a function - it is because the way in which fmt's argument types are interpreted are dependent on the first argument - functions in rust do not work that way. To quote you earlier 'Different things though look different.' - although a more expressive type system would eliminate the need for such 'hacks', the design choice seemed to be macros over varargs and allowing varags to be implemented using them. quote:It's called a butt ugly syntax for a type system. To quote you earlier 'Different things though look different.' - Each of those pointer types have different behaviours and costs attached - most notably unique pointers are the only ones allowed to be passed between processes iirc. quote:How do you load data into a texture buffer? As for loading a texture into a buffer, one would assume that they create a mutable buffer, as opposed the default immutable buffer. I thought the clue would be in the whole 'by default' implying an option otherwise. quote:Why is failing to compile with a type error not an option? rust aims for highly robust programs - it is more conservative about what programs it accepts than many other languages. really I don't want to defend rust here but only to say that it hasn't been properly introduced. if you're curious about it I would highly recommend the faq and the design docs over what has been poorly explained here. I think rust deserves a fair trial*. even so I still don't get the whole magic semicolon thing * rob pike has somewhat angry words about this http://commandcenter.blogspot.com/2011/12/esmereldas-imagination.html - to some extent it is right, but at other times it can be a failure to communicate the design constraints of the language. tef fucked around with this message at 02:03 on Jan 31, 2012 |
# ? Jan 31, 2012 01:56 |
|
I see.
|
# ? Jan 31, 2012 01:59 |
|
yaoi prophet posted:
ArchLinux? I haven't installed it in a while, but the installer was pretty barebones for such a nice customizable distro.
|
# ? Jan 31, 2012 02:37 |
|
Geekner posted:ArchLinux? I haven't installed it in a while, but the installer was pretty barebones for such a nice customizable distro. Debian testing. I wound up just picking 'standard system' since I'm pretty sure the top one installs X and poo poo and this was going to be a dev VM.
|
# ? Jan 31, 2012 02:42 |
|
yaoi prophet posted:Debian testing. I wound up just picking 'standard system' since I'm pretty sure the top one installs X and poo poo and this was going to be a dev VM. X is still useful, you know.
|
# ? Jan 31, 2012 03:16 |
|
Geekner posted:ArchLinux? I haven't installed it in a while, but the installer was pretty barebones for such a nice customizable distro. That's some hardcore barebones.
|
# ? Jan 31, 2012 04:00 |
|
tef posted:We're all terrible. Basically yeah, I didn't try it and was talking about impressions I got from the documentation. Interestingly enough, while I was writing that post I was compiling the Rust compiler/toolsuite. I still haven't gotten around to trying it yet but it does look interesting. It certainly wasn't fair of me to pass judgement without trying it. That said I still have some confusion about the ; thing and the () for nil thing, but overall they're pretty minor. (the problem I have with () for nil is that in rust specifically tuples need to have arity strictly greater than 1, so an empty tuple for nil doesn't really make much sense to me.)
|
# ? Jan 31, 2012 05:15 |
|
the talent deficit posted:you're going to have to explain how a compiler can infer whether input will lie in a specified domain
|
# ? Jan 31, 2012 07:19 |
|
Janin posted:Rust is statically typed, so the compiler already knows the full input domain, and whether there are any unmatched portions of it for any given alt expression. no it doesn't. tell me how to statically check this: code:
Look Around You posted:That said I still have some confusion about the ; thing and the () for nil thing, but overall they're pretty minor. (the problem I have with () for nil is that in rust specifically tuples need to have arity strictly greater than 1, so an empty tuple for nil doesn't really make much sense to me.) the semi colon performs two functions in rust. one is as a statement terminator: code:
code:
a valid criticism would be that two similar but different bits of syntax use the same glyph, but i think that is probably because the rust developers saw the criticism erlang got for it's varied expression terminators and chose to hew as close as possible to algolish languages. the talent deficit fucked around with this message at 08:23 on Jan 31, 2012 |
# ? Jan 31, 2012 08:04 |
|
I'm pretty sure the compiler can work out that the str type can contain more than two possible values, and thus that in the absence of a default case the code is missing something.
|
# ? Jan 31, 2012 08:20 |
|
Jabor posted:I'm pretty sure the compiler can work out that the str type can contain more than two possible values, and thus that in the absence of a default case the code is missing something. the default case is not required, which is the point. that is a perfectly valid (and sensible) rust program. the compiler has no idea whether that alt block will receive a valid string. it can only possibly be a runtime error.
|
# ? Jan 31, 2012 08:25 |
|
Dude that was harsh, you totally called those guys out in Rust code.
|
# ? Jan 31, 2012 08:34 |
|
the talent deficit posted:no it doesn't. tell me how to statically check this: Type error: could not infer type "janin" | "zombywuf" from str But yeah, you had every opportunity here to provide an example showing that such an inference mechanism would involve solving the halting problem, in wich case I would only be left with the argument "Don't include unsound features in your typesafe language." Instead though, you presented a program that has an infinite number of ways of crashing at runtime as an example of Rust's safety features. Well done. quote:the semi colon performs two functions in rust. one is as a statement terminator: off the top of my head all of these are better: code:
|
# ? Jan 31, 2012 09:45 |
|
How about code:
|
# ? Jan 31, 2012 09:56 |
|
OCaml uses the semicolon for the same purpose, but it does not do anything weird with returning unit. code:
|
# ? Jan 31, 2012 10:08 |
|
The problem I have with "a block returns it's last value if it has no semicolon" is a couple things. Here's an example which compiles fine and acts like you'd expect: code:
code:
code:
The error descriptions that the compiler generates are pretty good but that's kind of a weird, subtle bug IMO.
|
# ? Jan 31, 2012 13:54 |
|
the talent deficit posted:no it doesn't. tell me how to statically check this: I don't understand why you claim this is impossible. The compiler knows the input domain (all strings). It knows the available cases (a subset of strings). If there is no default case, then it knows the 'alt' expression is incomplete. The error message would look something like: code:
|
# ? Jan 31, 2012 17:51 |
|
Janin posted:GHC does exactly this. If there are unmatched cases, it prints them (as a warning, though, not an error). You could easily do the same thing for Rust. It's trivial to detect non-exhaustive patterns, I never claimed it wasn't. I was refuting the claim that non-exhaustive patterns should be a type error and not a runtime error.
|
# ? Jan 31, 2012 18:42 |
|
It seems to me like requiring exhaustive patterns makes sense for some types but not other types. Some types are small algebraic types, with a handful of cases that can be completely enumerated. These should require all cases to be handled explicitly. There are also integer types. These should fail with a run time error when a case isn't handled. That's better than, for example, infinitely looping when an erroneous negative input is given.
|
# ? Jan 31, 2012 19:10 |
|
the talent deficit posted:It's trivial to detect non-exhaustive patterns, I never claimed it wasn't. Zombywuf originally posted that a non-exhaustive pattern should cause a compile-time error. You posted that the compiler can't do this, even though it obviously can. shrughes posted:It seems to me like requiring exhaustive patterns makes sense for some types but not other types. Some types are small algebraic types, with a handful of cases that can be completely enumerated. These should require all cases to be handled explicitly. There are also integer types. These should fail with a run time error when a case isn't handled. That's better than, for example, infinitely looping when an erroneous negative input is given.
|
# ? Jan 31, 2012 22:32 |
|
Go Twitter!
|
# ? Feb 1, 2012 14:57 |
|
Suspicious Dish posted:Go Twitter! They are going to have a lot of typing to do when the number of seconds in a minute changes. (Ya, I know it is generated by a script) taqueso fucked around with this message at 16:35 on Feb 1, 2012 |
# ? Feb 1, 2012 16:33 |
|
|
# ? May 14, 2024 00:38 |
|
code:
|
# ? Feb 1, 2012 18:12 |