|
Subjunctive posted:also yes agree, clone everything until the profiler tells you otherwise how expensive is it to back this off once you figure out that allocating is expensive? my intuition here is informed by java where the idiomatic style is allocation intensive and once you learn that it’s hurting your p99 latency in production too much you’re just hosed and might as well rewrite (in rust)
|
# ? Jan 22, 2024 19:45 |
|
|
# ? May 26, 2024 12:27 |
|
oh or you can go full mechanical sympathy and write no-allocation from the start which is kinda like writing a ray tracer in logo (not a typo I do mean turtle graphics (turtle graphics owns I wonder if anyone has written it in rust yet (maybe I can put that on my github)))
|
# ? Jan 22, 2024 19:47 |
|
you have to propagate references through the call chains, but I haven’t found it to be too bad. sometimes you have to make a change in some basic thing and then you chase the compiler through the consequences, but it’s more tedious than difficult, and doing the equivalent in C++ was guaranteeing that I would be staring at nightly-build crash reports for weeks I do find that I write more small functions in Rust than I did in (pre-modern) C++, though, which provides more choke points for incrementally removing cloning
|
# ? Jan 22, 2024 19:48 |
|
rewriting aways excessive cloning in Rust is (relatively) easy once you're reasonably experienced with it. it's a bit like nice type systems for more general changes. Ownership and borrowing means you can start making the change, then just spiderweb out through compiler errors to all the necessary consequences, then Everything Just Works once it compiles again. the only really tricky part is there's a greater frequency of trying something and discovering it just won't work, and you have to try a different approach instead. But it'd be pretty hard to have the same allocation rate problems as Java. Java suffers hard from a default assumption of heap allocation. Cloning in Rust isn't necessarily a new allocation at all.
|
# ? Jan 23, 2024 00:11 |
|
Athas posted:Doesn't matter, GHC has an extension for dynamic scoping. lol of course it does
|
# ? Jan 23, 2024 01:21 |
|
Visions of Valerie posted:go agda or go home hell yeah and also I’m convinced Lean is gonna be the next big thing for type-touches
|
# ? Jan 23, 2024 03:35 |
|
Subjunctive posted:also yes agree, clone everything until the profiler tells you otherwise and when the profiler does tell you otherwise, rewrite everything because you can't easily retrofit references into your code that was designed around copying everything quote:I once argued that the value of this strategy pointed towards making cloning more automatic or lighter-weight in terms of syntax, but as with so many things it’s probably for the best that people don’t listen to me C++ does this and it's a terrible idea
|
# ? Jan 23, 2024 10:06 |
|
sure you can, just wrap the problematic struct in an Rc<> and clone that around instead
|
# ? Jan 23, 2024 10:45 |
|
Zlodo posted:and when the profiler does tell you otherwise, rewrite everything because you can't easily retrofit references into your code that was designed around copying everything so you end up doing the rewrite and it turns out it was a trivial flawed assumption after all and now the rewrite also won't work and maybe you should just revert those changes but hang on, maybe you should etc
|
# ? Jan 23, 2024 11:24 |
|
Visions of Valerie posted:in other words, the problem is APL exactly, which is why S-expressions are the superior syntax for a language even “conveniences” like implicitly non-evaluated arguments suck, it’s better to have explicit quoting/unquoting/splicing constructs that work uniformly so everything looks and behaves like function application unless explicitly marked otherwise
|
# ? Jan 25, 2024 05:29 |
|
sexpr languages make everything look syntactically like function application, but in practice programs are littered with special forms that semantically break the evaluation rule. i see it as a hideous false simplicity logo and rebol have a similar structure to lisps, but replace eagerly evaluated sublists with lists that are always "quoted by default", resulting in a much more uniform evaluation rule. in logo especially lots of things that would need to be a macro in lisp can be written as an ordinary function
|
# ? Jan 25, 2024 06:23 |
|
yeah that’s why I said I don’t like special forms, just make it all look and behave like function application, the cost of having special syntax for quote/quasiquote/splice is worth it if it’s the only special syntax you need
|
# ? Jan 25, 2024 11:27 |
|
"different things should look different" tired, boring "everything should look the same, because i read sicp once" incredible, awe inspiring it's no wonder lisp did everything first, well, except popularity and adoption
|
# ? Jan 25, 2024 12:09 |
|
lispers will tell you "code is data" and then write a long essay explaining that 9/11 wouldn't happen if planes were more like lisp, where code isn't data
|
# ? Jan 25, 2024 12:12 |
|
tef posted:lispers will tell you "code is data" and then write a long essay explaining that 9/11 wouldn't happen if planes were more like lisp, where code isn't data well obviously, it’d have been (/ 9 11)
|
# ? Jan 25, 2024 12:24 |
|
https://paulgraham.com/hijack.html fwiw
|
# ? Jan 25, 2024 12:39 |
|
lmao
|
# ? Jan 25, 2024 12:53 |
|
ive been saying this
|
# ? Jan 25, 2024 13:02 |
|
Hijacking a plane by buying 257 tickets
|
# ? Jan 25, 2024 13:07 |
|
Only a programmer deeply versed in the risks and mitigations of buffer overflows could device the idea of locking the cockpit door.
|
# ? Jan 25, 2024 13:27 |
|
Soricidus posted:well obviously, it’d have been (/ 9 11) lol
|
# ? Jan 25, 2024 13:52 |
|
MononcQc posted:Go: just write the loving code my dude, ship a feature. What we really want is a fast toolchain and no way to let anyone get too fancy, and fix the problems with architecture and process i have been learning about this firsthand over the last nine months and sometimes it feels like it's too easy to just write the code. i know the language isn't responsible for a deficit of architectural vision and planning but it sure feels like it's an enabler sometimes. door 1: sit down and think hard about the application's concurrency requirements now and in the future door 2: just add more goroutines lol
|
# ? Jan 25, 2024 14:35 |
|
obviously there are places for special forms (what are you going to do, lift each branch of an ite into a lambda to defer its evaluation??) but like operator overloading the real crime is when the language lets programmers define their own evaluation semantics looking at you, scala
|
# ? Jan 25, 2024 15:46 |
|
raminasi posted:i have been learning about this firsthand over the last nine months and sometimes it feels like it's too easy to just write the code. i know the language isn't responsible for a deficit of architectural vision and planning but it sure feels like it's an enabler sometimes. when writing go you are required to just type continuously until your program is complete and working. pausing to ever think about design or abstractions is a sin against pike.
|
# ? Jan 25, 2024 18:49 |
|
question mark exclamation point question mark exclamation point, except it's if err not equal nil return nil comma err
|
# ? Jan 25, 2024 19:11 |
|
Dijkstracula posted:obviously there are places for special forms (what are you going to do, lift each branch of an ite into a lambda to defer its evaluation??) but like operator overloading the real crime is when the language lets programmers define their own evaluation semantics operator overloading is fine the real real crime is people who disagree with me. and unary -
|
# ? Jan 25, 2024 19:15 |
|
what's wrong with unary -
|
# ? Jan 25, 2024 19:16 |
|
seperating the negation/subtraction symbol and negative numeric literals into - and _ is one of the very few things I think J syntax gets right
|
# ? Jan 25, 2024 19:30 |
|
Zlodo posted:what's wrong with unary - it’s rarely used and makes the semantics of - context-dependent
|
# ? Jan 25, 2024 19:55 |
|
unary - is fine. it’s unary + that has no reason to exist
|
# ? Jan 25, 2024 20:06 |
|
in js, unary + is very useful: "coerce to number"
|
# ? Jan 25, 2024 20:10 |
|
Plorkyeran posted:when writing go you are required to just type continuously until your program is complete and working. pausing to ever think about design or abstractions is a sin against pike. you'd think that go popularized microservices due its low process overhead compared to other languages, but it's actually because go is the only language where your code is written in the exact same way if you have 1 endpoint or 100 in your codebase
|
# ? Jan 25, 2024 20:29 |
|
Soricidus posted:unary - is fine. it’s unary + that has no reason to exist much like…your posts!!!
|
# ? Jan 25, 2024 20:56 |
|
the great thing about go is that everyone says “just use goroutines and channels and you don’t have to worry about data races” but then they start profiling and look at the dispatch costs for that big piece of data and say “well, let’s just put a lock in this struct that you have to take and we’ll put a big comment here”. and it works OK! the load graphs drop a bit and get screenshotted into promo packets then someone mistypes “RWLock” and “RLock”—or they misunderstand closure rules—and you have a silent race and then you’re chasing thousands of data races in just your test suite
|
# ? Jan 25, 2024 21:02 |
|
Subjunctive posted:then someone mistypes “RWLock” and “RLock”—or they misunderstand closure rules—and you have a silent race and then you’re chasing thousands of data races in just your test suite this is a really good blog post
|
# ? Jan 25, 2024 21:25 |
|
lol mutex is a copyable value type
|
# ? Jan 25, 2024 21:33 |
|
that go code is so hard to read, constant arrows and syntax im dying and the word go everywhere
|
# ? Jan 25, 2024 21:42 |
|
rjmccall posted:lol mutex is a copyable value type does go have uncopyable types?
|
# ? Jan 25, 2024 21:44 |
|
no, definitely not. but it's extremely go-ish to be like "well we certainly don't want to have to reference-allocate a mutex" and completely ignore the pitfalls of that decision given that the language can't express any of the restrictions that would make value mutexes sane. "it's fine, this is how it works in c and people can handle it" i wonder what happens if you copy a locked mutex
|
# ? Jan 25, 2024 21:47 |
|
|
# ? May 26, 2024 12:27 |
|
tef posted:this is a really good blog post the sigplan paper is great too
|
# ? Jan 25, 2024 21:56 |