|
Took me a second
|
# ? Jul 20, 2016 22:04 |
|
|
# ? Jun 6, 2024 09:05 |
|
are y'all ready for the revolution
|
# ? Jul 23, 2016 07:46 |
|
Ctrl+F transpiler Whew.
|
# ? Jul 23, 2016 10:55 |
|
why not just use rust?
|
# ? Jul 23, 2016 11:13 |
|
i just came upon this article: http://joeduffyblog.com/2016/02/07/the-error-model/ it talks about the error handling in a language that was never released that was used to implement a kernel that was also never released. that kernel being midori. since the article is very long, have a summary: checked exceptions. and somewhat longer: some things cause 'abandonment': dereference a null pointer, an incorrect cast, out of memory, divide by zero, overflow and a few others. these can never be handled and cause the process to abort immediately. apparently, you could opt out of this if you really needed to. method definition requires 'throws' if it wants to throw an exception. code:
code:
code:
also, methods could have pre- and postconditions which were always evaluated on runtime unless the compiler could statically assert them: code:
|
# ? Jul 23, 2016 11:41 |
|
Not sure I want my kernel aborting when OOM or some internal counter overflows.
|
# ? Jul 23, 2016 13:00 |
|
JawnV6 posted:are y'all ready no
|
# ? Jul 23, 2016 14:25 |
|
Shinku ABOOKEN posted:why not just use rust?
|
# ? Jul 23, 2016 15:01 |
|
I believe their suggestion is to replace the llvm IL with rust, then to use rust to generate machine code. it is not clear why this is preferable, and is apparently left as an exercise for the reader
|
# ? Jul 23, 2016 15:25 |
|
Shinku ABOOKEN posted:why not just use rust? no one gives a poo poo about it except mozilla
|
# ? Jul 23, 2016 15:28 |
|
rustlang is sometimes presented as low level, but it's basically a "functional" programming language in sheep's clothing that has similar or higher levels of abstraction than Java/C#/C++ rustlang does kind of have two worlds of low level unsafe and higher level safe
|
# ? Jul 23, 2016 16:33 |
|
the self-highlighting is my favorite stylistic flourish, especially the one about a "programmable compiler" that sounds suspiciously like LLVM, but the TODO: list is breathtaking PRO: 1) Bolting types onto languages that don't have it CON: 1) No actual compiler hook support yet
|
# ? Jul 23, 2016 17:10 |
|
oh good, i hadn't had someone who knows nothing about pl implementation tell me that i'm doing it wrong enough recently my favorite idea here is that implementing different languages in terms of a common ir obviously means that they just interoperate. like, scala is a jvm language, and it just interoperates with java, right? that didn't require careful language design and a lot of attention to detail, it actually just works out because they both compile to bytecode
|
# ? Jul 23, 2016 17:26 |
|
i'm the footnote that sheepishly admits that rust doesn't have a formal standard for every other language to target
|
# ? Jul 23, 2016 17:34 |
|
i d k about rust but i want to poo poo post about the semicolon so here is a good place as any to complain about rust's trivial design decisions and argue that the carelessness of the small details implies a carelessness of the big picture or something so, rust has a semicolon, a separator, a delimiter, but not a terminator. foo; and foo are not semantically equivalent the idea is that in "a; b; c; d" d is the value, but "a;b;c;d;" nothing is the value the rationale as i hear it, is to avoid having a return statement, or such that "everything is an expression" so rust could have done a couple of things to handle the conflict between return statements and expressions a) explicit nil if you want the last value of an expression to be nothing, you put nothing there (well, something, a nil), rather that taking something away (the semicolon) b) eh, gently caress it, return is special put a return statement to return a value, without it, don't return anything. this makes short functions 7 characters longer c) ok, return is special, but so is not using return if there is no return statement, the last value is the return value if there is one, then there is no implicit return statement d) reify return value and assign it fn butt_check(lhs: u32, rhs: u32) -> out: bool { out = lhs.rotate(rhs) } e) rust's magic semicolon expressions that end in ; have no value anyway come to your own preference, but e) is at the bottom for me i've spent a small lifetime with prolog, a language that has lists that end in a full stop. a special case for the last item in a list is pain and suffering trailing commas are great in data structures, cause less noise in diffs and have been ok. tef fucked around with this message at 18:15 on Jul 23, 2016 |
# ? Jul 23, 2016 18:02 |
|
ynohtna posted:i'm the footnote that sheepishly admits that rust doesn't have a formal standard for every other language to target
|
# ? Jul 23, 2016 18:02 |
|
rjmccall posted:oh good, i hadn't had someone who knows nothing about pl implementation tell me that i'm doing it wrong enough recently must make a change tbh quote:my favorite idea here is that implementing different languages in terms of a common ir obviously means that they just interoperate. like, scala is a jvm language, and it just interoperates with java, right? that didn't require careful language design and a lot of attention to detail, it actually just works out because they both compile to bytecode i d k my favourite thing is somehow transforming all other code to satisfy rust's borrow checker
|
# ? Jul 23, 2016 18:08 |
|
no wait it's when he says c doesn't compile to x86 but rust compiles to llvm
|
# ? Jul 23, 2016 18:08 |
|
a brief history of metaprogramming: it is a terrible idea please stop doing it
|
# ? Jul 23, 2016 18:10 |
|
rust semicolons have a pretty high stockholm syndrome effectiveness as far as i can tell the option requiring explicit return doesnt solve the thing where you want to write x = if foo { bar } else { baz }. i think weve talked about this before tho
|
# ? Jul 23, 2016 18:19 |
|
tef posted:foo; and foo are not semantically equivalent this reminds me of one of the weirdest verilog gotchas. you can begin a variable with a \, which makes it consume "all characters until the next whitespace". so code:
|
# ? Jul 23, 2016 18:21 |
|
tef posted:i d k about rust but i want to poo poo post about the semicolon this is all terrible
|
# ? Jul 23, 2016 18:22 |
|
not your opinions but just that rust handles semicolons so comically
|
# ? Jul 23, 2016 18:23 |
|
also the opinions, reified returns are maybe the worst possible option in the history of coding but the rust semicolons are pretty bad
|
# ? Jul 23, 2016 18:23 |
|
Asymmetrikon posted:also the opinions, reified returns are maybe the worst possible option in the history of coding Agreed.
|
# ? Jul 23, 2016 18:24 |
|
Once you decide to have semicolons be an expression separator where everything has to be an expression, you pretty much walk straight into that decision, and it's the best choice under those conditions, because otherwise if/else expressions need explicit nils, or type checking has to get weird. And I heard that making everything be an expression was the right decision, because
|
# ? Jul 23, 2016 18:39 |
|
yeah it seems like an obvious followthrough of the "everything must be an expression" rule, which is not a design decision i agree with
|
# ? Jul 23, 2016 19:00 |
|
tef posted:trailing commas are great in data structures, cause less noise in diffs and have been ok. this is the thing that annoys me the most about json, moreso than the lack of (approval for) comments
|
# ? Jul 23, 2016 19:11 |
|
i like making everything an expression b/c it simplifies reading code in the majority of cases b/c it restricts control flow and what is allowable this code:
code:
making everything an expression also results in more consistent, shorter syntax for stuff like lambda expressions instead of having a bunch of special casing in your language this: code:
code:
|
# ? Jul 23, 2016 19:42 |
|
also rust's semicolon thing is similar to using progn in lisps to sequentially chain expressions together to form a larger expression given this context, rust's semicolon is very consistent and not some random arcane thing with wierd rules
|
# ? Jul 23, 2016 20:09 |
|
comedyblissoption posted:i like making everything an expression b/c it simplifies reading code in the majority of cases b/c it restricts control flow and what is allowable Plus there's the question of return's scope when it's in lambdas or loops or whatever
|
# ? Jul 23, 2016 20:58 |
|
making everything an expression also makes it easier to idiomatically work with immutable/const values
|
# ? Jul 23, 2016 21:12 |
|
comedyblissoption posted:also rust's semicolon thing is similar to using progn in lisps to sequentially chain expressions together to form a larger expression huh ?
|
# ? Jul 23, 2016 21:17 |
|
comedyblissoption posted:making everything an expression also makes it easier to idiomatically work with immutable/const values no it doesn't here's how you idiomatically work with immutable values: you do everything you would normally do, except without trying to mutate them
|
# ? Jul 23, 2016 21:46 |
|
Weekend Bridges posted:huh ? code:
code:
|
# ? Jul 23, 2016 21:54 |
|
the rust semicolon thing i thought is that rust a; b; c is lisp (progn a b c) and rust a; b; c; is lisp (progn a b c (values))
|
# ? Jul 23, 2016 22:04 |
|
rjmccall posted:no it doesn't w/o these constructs evaluating to expressions you must take one of the following approaches:
all of the above approaches are more verbose and harder to read than compared to an expression based approach is there another approach that I am missing? these issues may partly be the reason why a lot of langs have the ternary expression
|
# ? Jul 23, 2016 22:05 |
tef posted:i d k about rust but i want to poo poo post about the semicolon Who cares, you get used to it pretty quick and the compiler yells at you if you mess it up. It's not like this is JavaScript's semicolons or something.
|
|
# ? Jul 23, 2016 22:07 |
|
rjmccall posted:no it doesn't
|
# ? Jul 23, 2016 22:09 |
|
|
# ? Jun 6, 2024 09:05 |
|
rjmccall posted:no it doesn't is that really true? don't languages like haskell just present you with an immutable interface for data but under the hood much of it is mutated anyhow because otherwise it would be super slow? asking for amfriend
|
# ? Jul 23, 2016 22:09 |