|
Carthag Tuek posted:imo the best garbage collector is aliasing the compiler name to rm -f big fan of #!/bin/rm -f
|
# ? Jan 26, 2024 16:07 |
|
|
# ? May 26, 2024 22:23 |
|
Dijkstracula posted:all I know is I spent six months programming in Rust and having just migrated back to something else in a GCed language I gotta say: it's nice to have a garbage collector, just use a strongly-typed functional language with a garbage collector ah, f#
|
# ? Jan 26, 2024 16:21 |
|
Bloody posted:ah, f# very acceptable choice
|
# ? Jan 26, 2024 16:39 |
|
It is tolerable, but every programming task where you cannot use Standard ML is an indication that we do not inhabit the best timeline.
|
# ? Jan 26, 2024 16:51 |
|
Athas posted:It is tolerable, but every programming task where you cannot use Standard ML is an indication that we do not inhabit the best timeline. can i interest you in c#?
|
# ? Jan 26, 2024 17:03 |
|
fart simpson posted:can i interest you in c#?
|
# ? Jan 26, 2024 17:05 |
|
mystes posted:have you given up on haskell to become a c# stan? Is that why you posted a video about how early return is good and implicit return is bad? i didn’t watch that video and didn’t know what it was about i just thought guys face was funny
|
# ? Jan 26, 2024 17:06 |
|
fart simpson posted:i didn’t watch that video and didn’t know what it was about i just thought guys face was funny
|
# ? Jan 26, 2024 17:08 |
|
mystes posted:I'm making a funny face now too!
|
# ? Jan 26, 2024 17:40 |
|
fart simpson posted:i didn’t watch that video and didn’t know what it was about i just thought guys face was funny turn on your monitor
|
# ? Jan 26, 2024 22:34 |
|
Nomnom Cookie posted:it is not possible, as a golang library author, to create a struct type that is public and also retain control over how that struct is created or initialized. the only way to do that is to keep the struct private and expose an interface. let me play So while you are technically correct(no control over creation or initialization of a public struct), it definitely is possible to control the initialization of a public struct’s non-public fields if you’re willing to do a stupid bullshit dance and delay initialization until a first method call. ;-) Idiomatically, the thing to do if you should need specific initialization is one of: - write a NewMyStruct() constructor, move on with life - (do some silly poo poo) make all the public fields nonpublic, then expose them as func (m *MyStruct) Field() *T { return &m.t }, which is technically less boilerplate than having to write both a setter and a getter I guess what I’m saying is, your statement applies most meaningfully to the public fields of public structs and there are options which do not involve a single interface.
|
# ? Jan 27, 2024 14:56 |
|
prisoner of waffles posted:let me play none of the idiot hell fucker options you presented address the fact that golangs mutex can be copied as a necessary consequence of the idiot hell fucker language design
|
# ? Jan 27, 2024 16:36 |
|
they called it golang because when you see it you go use another language
|
# ? Jan 27, 2024 16:51 |
|
Nomnom Cookie posted:none of the idiot hell fucker options you presented address the fact that golangs mutex can be copied as a necessary consequence of the idiot hell fucker language design yep. it's not a good ergonomics choice, but it does allow you to embed a mutex directly in a struct which, as someone observed upthread, has the (small but not meaningless) performance benefit of allowing you to use a mutex on a struct without an extra indirection; this makes golang's sync.Mutex potentially better for use inside "tight loops", "heavily-called code", etc. Nomnom Cookie posted:it is not possible, as a golang library author, to create a struct type that is public and also retain control over how that struct is created or initialized. the only way to do that is to keep the struct private and expose an interface. these are the goalposts you put up, I aimed at a similar but maybe not the same pair of uprights, and the kick was good. was it an idiot hellfucker kick? yes. I agree that the ability to copy mutexes is dumb as hell and that the attitude of the go language designers is basically, "hey, sync.Mutex is a real programmer thing; if you use it wrong it's your fault" and that attitude is, in general, a lovely way for PL designers to act. at this point Everyone In The Know knows that go is somewhere near "C made easier with some footguns, mostly in concurrency"
|
# ? Jan 27, 2024 16:57 |
|
mr Scoop posted:they called it golang because when you see it you go use another language yep
|
# ? Jan 27, 2024 16:59 |
|
FlapYoJacks posted:Rust is excellent because of the borrow checker. If it's bopping you on the head with a newspaper, it's for a good reason. It is designed from the ground up to be an extremely safe language regarding thread and memory safety. If you have a multi-threaded program or a program that needs to be 100% secure, then you can be sure of those things if your program compiles. There's a reason why the kernel accepts rust and a lot of crypto applications are moving to or have moved to Rust. this completely got me, well done
|
# ? Jan 27, 2024 17:07 |
|
me, a very smart person, acquiring a mutex in my tight loop and performance sensitive code:
|
# ? Jan 27, 2024 17:21 |
|
mystes posted:have you given up on haskell to become a c# stan? Is that why you posted a video about how early return is good and implicit return is bad? I also absolutely did not watch the video but this reminds me of the time I was the lab instructor for an intro-to-C class and the professor forbade the use of, in addition to goto, break and continue, and failed to tell anyone this so people would just lose marks for totally reasonable implementations outside the language subset he inexplicably wanted (you can imagine that when teaching the class came around to me I not only backed this rule out but went on a tear about why goto in a small number of common cases, can be fine actually (e: https://docs.google.com/presentation/d/1MmfYZLQO6eEZuP0wQl_w4VnVSi2y786MHMLh-Et_Dwg/edit#slide=id.gca5b8bd19c_0_121) Dijkstracula fucked around with this message at 17:39 on Jan 27, 2024 |
# ? Jan 27, 2024 17:27 |
|
Dijkstracula posted:but this reminds me of the time I was the lab instructor for an intro-to-C class and the professor forbade the use of, in addition to goto, break and continue, and failed to tell anyone this it's fine to have style preferences like that but don't not state them and then take off points for people failing to read your mind as if your personal style preferences are a universally agreed upon standard, which they aren't.
|
# ? Jan 27, 2024 17:31 |
|
mystes posted:that's absolutely infuriating he went on a tear in the instructors' meeting about how students weren't following this rule, and I was all "uh, what rule" and he was very concerned that I might have demonstrated the use of break and continue with students then the other lab instructor, who'd taught with this guy before, stepped in and apologised, saying she should have informed me of the rule, and it's like "first of all this 'rule' is idiotic and also second you have no reason to apologise and third if nobody, students or lab instructors, knows about it then maybe the problem is with the greybeard at the front of the
|
# ? Jan 27, 2024 17:34 |
|
Didn't you read the syllabus? The only breaks you get are university mandated.
|
# ? Jan 27, 2024 17:35 |
|
mystes posted:it's fine to have style preferences like that It is not fine to have style preferences like that. It's reading a Dijkstra paper title without understanding what Dijkstra was actually mad about (goto that can change frames, which isn't what C has). It's perpetuating second-hand FUD, reading XKCD and nodding while repeating "the raptors won't get me this way". It's encouraging people to create complex state machines of sentinel variables to exit loops, and making GBS threads all over readability of function exit paths that need to deallocate memory. Blind "don't use that" doesn't teach anything, whether it be why a construct exists, or how to think about its tradeoffs.
|
# ? Jan 27, 2024 17:46 |
|
hey left recursion nerds, what's your favourite way to handle left recursion in top down parsing i have this parsing evaluation grammar, i want to extend it with means of defining stuff like infix operators. like `e := e "+" e`, and i'm mulling over the various ways of trying to make it work 1. don't do it, and just force users to write right recursive grammars 2. rewrite the grammar internally to something without left recursion, but return the original parse tree 3. shove an operator precedence parser into the back of the peg engine, and let the user define operators for a given parse rule 3. extend the peg algorithm to handle left recursive grammars, either through bounded recursion or memoization option 1 isn't great, option 2 and 4 are kinda the same in that they both lose the execution model of pegs, option 3 is basically a pratt parser, or something with precedence climbing. i'm really not sure what the best option is. it feels like "just handle left recursion" is a more invisible ux, but "here is a means to define operators" is a better way to define grammars. i've been leaning towards implementing the memoization trick to just make left recursion work, but then it's easy to write something left associative over right associative by accident, and i'm not quite sure if making operator precedence implicit is the right choice either
|
# ? Jan 27, 2024 18:05 |
|
Dijkstracula posted:
your lecture slides are good and i would have very much appreciated hearing the actual rationale for delineating good/bad practices in my java/c++/c classes when i was in uni rather than being expected to memorize charts of operator precedence
|
# ? Jan 27, 2024 18:25 |
|
ometa added left recursion to peg and wrote at least one paper about it. I think it was using memoization but do not recall at this point.
|
# ? Jan 27, 2024 18:28 |
|
yep, that's the one https://web.cs.ucla.edu/~todd/research/pepm08.pdf the other one i'm aware of is the https://arxiv.org/pdf/1207.0443.pdf bounded left recursion one
|
# ? Jan 27, 2024 18:55 |
|
Voodoo Cafe posted:your lecture slides are good and i would have very much appreciated hearing the actual rationale for delineating good/bad practices in my java/c++/c classes when i was in uni rather than being expected to memorize charts of operator precedence aw ty , love to beat bad habits learned from the other instructors out of my kids (you better believe the first thing I ripped out from the other instructor's material was the operator precedence table) Dijkstracula fucked around with this message at 19:53 on Jan 27, 2024 |
# ? Jan 27, 2024 18:57 |
|
mystes posted:that's absolutely infuriating hard disagree it is not fine to forbid use of break and continue. that is utterly deranged. even more deranged than permitting use of unary -
|
# ? Jan 27, 2024 20:51 |
|
tef posted:hey left recursion nerds, what's your favourite way to handle left recursion in top down parsing pop up a message box that says here’s a lookahead kid go get yourself a real grammar
|
# ? Jan 27, 2024 20:54 |
|
the real answer is it sounds to me like you’ve boxed yourself in by choosing peg too early. first figure out what set of accepted grammars has the right ergonomics then make a judgment on how you’re going to handle them. imo
|
# ? Jan 27, 2024 20:57 |
|
Visions of Valerie posted:It is not fine to have style preferences like that. It's reading a Dijkstra paper title without understanding what Dijkstra was actually mad about (goto that can change frames, which isn't what C has). It's perpetuating second-hand FUD, reading XKCD and nodding while repeating "the raptors won't get me this way". It's encouraging people to create complex state machines of sentinel variables to exit loops, and making GBS threads all over readability of function exit paths that need to deallocate memory. Blind "don't use that" doesn't teach anything, whether it be why a construct exists, or how to think about its tradeoffs. I do think that is the understanding of the Dijkstra paper that has been handed down to the present. If I understand that context correctly, it was before structured programming (i.e. control flow stays within a given function except for function calls and returns / gotos must remain in the same function) had become standard practice in all programming languages. Certainly it's notable that Dijkstra doesn't refer to being several levels deep into procedures and subprocedures with the word "stack" or "call stack". If I had to say *why* it had such memetic strength, it would be the first sentence: quote:For a number of years I have been familiar with the observation that the quality of programmers is a decreasing function of the density of go to statements in the programs they produce. A very concise, objective or objective-sounding way to figure out who deserves abuse as a bad programmer is a meme that has legs. Disallowing the use of break and continue just feels like an intensified sort-of-hazing attitude towards what constitutes "good programming" in an imperative (and to be more exact I guess ALGOL-family?) language.
|
# ? Jan 27, 2024 21:28 |
|
mr Scoop posted:they called it golang because when you see it you go use another language
|
# ? Jan 27, 2024 22:22 |
|
mr Scoop posted:they called it golang because when you see it you go use another language
|
# ? Jan 27, 2024 22:25 |
|
prisoner of waffles posted:Disallowing the use of break and continue just feels like an intensified sort-of-hazing attitude (when I taught the class I simply swapped it with the final assignment to fix this and lo and behold the assignment average wasn’t in the 30s any longer)
|
# ? Jan 27, 2024 22:52 |
|
quote:goto that can change frames, which isn't what C has
|
# ? Jan 27, 2024 23:28 |
|
dijkstra was really good at shitposting and definitely on the right side of history but he was writing at time where computing was just barely growing out of unimaginable resource constraints. writing software for basic rear end business processing on a machine so limited that you literally cannot afford a frame pointer. like you do not have enough budget to get a computer big enough that you can both have a frame pointer and deliver to spec
|
# ? Jan 27, 2024 23:34 |
|
that drives a style of programming with horrific side effects that absolutely did need to be abandoned asap, but it’s also true that dijkstra was a contemptuous rear end in a top hat who gets far more respect than he deserves
|
# ? Jan 27, 2024 23:35 |
|
Nomnom Cookie posted:it’s also true that dijkstra was a contemptuous rear end in a top hat who gets far more respect than he deserves
|
# ? Jan 27, 2024 23:47 |
|
Nomnom Cookie posted:the real answer is it sounds to me like you’ve boxed yourself in by choosing peg too early. first figure out what set of accepted grammars has the right ergonomics then make a judgment on how you’re going to handle them. imo i mean, i could give up on having negative lookahead and ordered choice, yes, but i've decided that returning shift/reduce errors isn't an improvement especially because i'm also parsing markup languages
|
# ? Jan 28, 2024 00:12 |
|
|
# ? May 26, 2024 22:23 |
|
pseudorandom name posted:C++ is asking the important question of how many different prefixes can we slap on "value" before the language is abandoned en masse inline static const std::unordered_map<const unsigned long long* const, const unsigned long long* const>* const butts = nullptr; You can use a std::tuple if you want to keep going. But using the STL might be cheating.
|
# ? Jan 28, 2024 00:26 |