It's worth mentioning that someone came up with a safe primitive (GhostCell) that allows you to implement doubly linked lists, trees with backlinks etc. without any dynamic checks and without any unsafe code. But it's a bit esoteric.
haxe is not a memelang. it is actually used (papers please ofr example). also it is made in ocaml, which is a meme lang used in israelite stuff. good morning sirs
nim has no roadmap or foundation. andreas is moronic >trust bro roadmap will come with zig 3.0, everything will be fixed soon bro just trust me bro
>ocaml is a memelang
I dunno if F# proves your point or it's contrary coming from Microsoft where it's 50/50 they wanted a ML done right or to use OCaml but not-made-here set in.
I unironically came in here to mention Lua and Rust.
Lua for some game dev stuff that ended up being moved to a more sensible engine, and Rust for some systems programming before I realized it was essentially just C plus those child-proof caps they put on bottles of pills to keep morons from swallowing the whole bottle.
That's the only thing Lua is used for. IMO that makes it a memelang. Although it's used for good reason, to be fair - it's got the best embedding story of any language I know of.
'memelang' here means the spate of languages trying to innovate in the C space
C replacements
I'd put Rust in there with V, Nim, Hare, Beef, Nim, Odin, Zig, Haxe
2 years ago
Anonymous
Whether a language is a memelang or not has nothing to do with its domain. It just so happens that there are a lot of "C killer" memelangs around. Rust also isn't a memelang. Sorry chuds, but it's actually used in the real world.
2 years ago
Anonymous
'here' -- as in this thread
get back to me when you move up a few esl tiers
2 years ago
Anonymous
It is a memelang. >"Just have an immutable reference that produces mutable references. It's so elegant! It's not a cope at all!"
Yes, they are actually called shared references, not immutable references. But 99% of the time it's accurate.
2 years ago
Anonymous
Anon... you reach them through an immutable reference 😐
>Interior mutability is a design pattern in Rust that allows you to mutate data even when there are immutable references to that data; normally, this action is disallowed by the borrowing rules. To mutate data, the pattern uses unsafe code inside a data structure to bend Rust’s usual rules that govern mutation and borrowing.
2 years ago
Anonymous
That specific documentation page confusingly calls them immutable references, but they are shared references.
https://doc.rust-lang.org/reference/types/pointer.html#shared-references-
self is immutable, yet sent_messages allows you to get both mutable and immutable references, and might panic during runtime if you mess the borrow checking rules which are check in runtime. So it's not just an ugly pattern, it also causes performance penalty
2 years ago
Anonymous
"Immutable reference" is an incorrect term. And it's important that these dynamic checks happen because otherwise it would be easy to produce UB. If you don't want dynamic checks, you can use atomics, Cell, or UnsafeCell (which is the "primitive" of interior mutability).
2 years ago
Anonymous
It's not, self is an immutable reference.
fn send(&self, message: &str) {
self.sent_messages.borrow_mut().push(String::from(message));
}
It is an ugly pattern. Basically all the Cells in Rust rely on the unsafe Cell, and whenever they use unsafe code it ends up in very convoluted and ugly code.
2 years ago
Anonymous
The book is wrong to call it an immutable reference. >Basically all the Cells in Rust rely on the unsafe Cell, and whenever they use unsafe code it ends up in very convoluted and ugly code.
This is nonsense.
2 years ago
Anonymous
Is self an immutable or mutable reference?
2 years ago
Anonymous
It's a shared reference.
[...]
any rustecean here is this seriously true?
you can't make a tree without unsafe code?
You can make a tree, but if you want backlinks then you need unsafe pointers or safe smart pointers (e.g. Rc).
It's not a shared reference. self in this method definition is an immutable reference.
>So?
So it's nonsense but it's true? 😐 Using unsafe code makes Rust code convoluted and hard to understand, because it's basically a hack around the borrow checker.
2 years ago
Anonymous
Calling it an immutable reference is wrong. Saying "unsafe code bad" is moronic.
It's not a shared reference. self in this method definition is an immutable reference.
>So?
So it's nonsense but it's true? 😐 Using unsafe code makes Rust code convoluted and hard to understand, because it's basically a hack around the borrow checker.
I think the proper comparison is to C++. Is unsafe Rust code much uglier than (also unsafe) C++ code?
2 years ago
Anonymous
I wasn't talking about that file, but when unsafe code gets abstracted and used, like RefCell, like the snippet I've shared that showed interior mutability.
Calling it an immutable reference is wrong. Saying "unsafe code bad" is moronic.
Fine, it's an immutable shared reference that points to RefCell which generates mutable references. Happy now? It is still ugly af
2 years ago
Anonymous
C++ doesn't need ugly patterns like interior mutability in the first place. So yeah, unsafe C++ looks better than unsafe Rust
2 years ago
Anonymous
You can't really compare "unsafe" code in Rust and C++
Because unsafe to Rust doesn't necessarily mean it's bad or will cause random memory access. Rust rules exclude some correct programs (which are used in many algorithms btw) because it sees it as a better trade off than allowing these correct programs but with the possibility of introducing incorrect ones. So this contradiction makes working with Rust really painful.
2 years ago
Anonymous
>So this contradiction makes working with Rust really painful.
No, it doesn't. I'd hazard a guess you have never (substantially) worked with Rust.
2 years ago
Anonymous
not that anon but what do you consider to be substantial code? rust programmers trial & error until the red squigglies disappear from what i've seen, very productive
2 years ago
Anonymous
How is this even an argument? But fine, let's roll with it. Let's ask someone who actually has a job at Netflix if it's painful to work with or not
2 years ago
Anonymous
He admits he's not good at writing Rust. Who gives a shit? I would never claim that Rust is easy to use. It just eliminates footguns (mostly).
2 years ago
Anonymous
Because he's afraid of rustroons after him. He messed around with rust more than with go, yet he managed to pick up go much easier and faster.
>Also I fail to see what this has to do with unsafe Rust.
You're the one who said that working with Rust isn't really painful, when to do anything useful in Rust you have to use all these abstractions over unsafe code which makes everything convoluted and ugly.
Even the definition of unsafe in Rust is inconsistent. For me, this is a big flaw in the language design. Calling safe programs unsafe just because. TypeScript doesn't have this problem. the any type is literally an any type. It doesn't have this dumb inconsistency and muddled thinking and definitions
2 years ago
Anonymous
He admits he's not good at writing Rust. Who gives a shit? I would never claim that Rust is easy to use. It just eliminates footguns (mostly).
Also I fail to see what this has to do with unsafe Rust.
2 years ago
Anonymous
Nobody calls RefCells elegant, they're just an escape hatch you need every once in a while. Not that remarkable. Far from the biggest problem Rust has and no worse than many of the problems other non-memelangs have.
Cell is zero-overhead and pretty clever.
The locks and atomics are great.
Is self an immutable or mutable reference?
So-called "immutable" references are shared references. "Mutable" references are unique references.
self is a shared reference.
Read this: https://smallcultfollowing.com/babysteps/blog/2014/05/13/focusing-on-ownership/
[...]
any rustecean here is this seriously true?
you can't make a tree without unsafe code?
If you want backlinks you need either unsafe code or runtime bookkeeping with reference-counting and whatnot.
Implementing data structures in Rust unfortunately isn't very easy. But on the other hand you can design a safe interface so that users of the data structure can't mess it up.
nim is nice but docs seem shitty to me. I don't know why but navigating their docs and figuring out how to do something is really hard work. For example lookup how to do async its really convoluted like half the docs are missing.
Haxe is nice very nice if the compile times weren't so long. 2s for a basic hello world just sucks. A c++ similar program compiles in ~0.1s.
If any of you anons are into math, you should check out lean4, big brains are using it to formalize mathematics.I tried to work through the tutorial, but had to drop it because of lack of free time. Seems very interesting tho.
>a tool I use literally every day in my workflow "rewrites in Zig" >its supposed to be 100% compatible drop in replacement, version written in C is no longer updated >its 5% faster, but crashes if a filename has invalid unicode >makes it completely unusable, since I process millions of random files daily
Yes, it usually takes around 12 hours to do the whole thing.
Its 230+TB across 18+ million files of porn. Somewhere in there, some filename crashes zigged ncdu.
2 years ago
Anonymous
6 hours?
Proof, the ncdu listing I generated for my last backup (after compiling v1)
2 years ago
Anonymous
Did you try to figure out which files kill it?
2 years ago
Anonymous
No, the generated file always ends in a different place, and it takes 6 hours to narrow down a bit. I looked into opening a bug report but they're not on github for hipster reasons. I'll probably just send an email
2 years ago
Anonymous
Just edit their code to log the files it is looking at somewhere.
>a tool I use literally every day in my workflow "rewrites in Zig" >its supposed to be 100% compatible drop in replacement, version written in C is no longer updated >its 5% faster, but crashes if a filename has invalid unicode >makes it completely unusable, since I process millions of random files daily
I hate memelangs now. The tool is ncdu.
to be fair, nothing handles unicode and any attempt is futile
Not handling Unicode means you don't care about malformed UTF-8.
Adding proper Unicode support means you'll handle valid UTF-8 better but you also have to address invalid UTF-8 somehow. The laziest way is to crash, slightly less lazy is to clean it with replacement characters. The proper way is to actually fall back to processing byte-by-byte but many people don't do this.
Rust has an overwrought system for invalid unicode called OsStr (which also does UTF-16 on Windows), and third-party libraries for other approaches. I don't know how Zig does things.
Perl one liners are allright under the scope they were created for and i think is way too demonized. If we strictly had followed the "nuke ill suited square in round pegs" principle Javascript would've died a long time ago (as rightfully should've).
I tried go. having a compiled C-like lang where unicode just werks was nice
but it had too many things that triggered my autism. like the package import nonsense, enforced formatting, unused vars being compile errors, etc. just shut the FRICK up and let me program
also got tired of typing if err != nil and _, everywhere
still a decent lang I might use it some more some time. it seemed good for webshit
I'm going to try Zig this weekend. I rejected V because its maintainer appears to be an amateur who handles criticism poorly, and Nim because I don't think it's really suitable for the same niche as C (it has a weird mix of low-level and high-level features, such as five optional garbage collection strategies).
I've read a fair bit of Haxe.
Zig, Nim, Odin, V and now Carbon have nothing to provide me that Go can't.
Haxe is super interesting to me because it could conceivably become a proper cross-platform game engine basis similar but more portable than dotnet/C#.
I know about heaps, it's how I played Dead Cells on OpenBSD, but to be "proper" cross platform to me that is possible with Haxe/Heaps would require two more generations of hardware with the current day ones still supported.
I'm saying Haxe has the possibly to kill remakes/remasters dead and you simply ship a new build of the exact same game to new customers who would trivially play multiplayer games with someone on 3 generations behind.
rust is more trouble than it's worth for anything I'd want to work on
I like nim but I don't like writing nim
zig is comfy but it's still too undercooked
if zig makes it to 1.0 with some of the proposed features I'll make the switch
yeah, rust
I tried Rust. That's why I hate trannies
I wish it were unsafe by default, and the safe stuff were opt-ins
that is stupid, rust's borrow checker stuff is just a second type system. it's not rocket science.
Show me how to build a tree with it then where each node points to the parent and children
Rust's borrow checker is so moronic.
>"Oh, you need multiple ownership? Forget about it lol"
any rustecean here is this seriously true?
you can't make a tree without unsafe code?
It's worth mentioning that someone came up with a safe primitive (GhostCell) that allows you to implement doubly linked lists, trees with backlinks etc. without any dynamic checks and without any unsafe code. But it's a bit esoteric.
i tried lua
zig is fine
does it compile to c or c++ like nim, I couldn't find an answer yet
haxe is not a memelang. it is actually used (papers please ofr example). also it is made in ocaml, which is a meme lang used in israelite stuff. good morning sirs
nim has no roadmap or foundation. andreas is moronic
>trust bro roadmap will come with zig 3.0, everything will be fixed soon bro just trust me bro
with nim*
>spreading nim fud
>can't even get the name right, confuses it with zig
there is a roadmap
https://github.com/nim-lang/RFCs/issues/437
>ocaml is a memelang
I dunno if F# proves your point or it's contrary coming from Microsoft where it's 50/50 they wanted a ML done right or to use OCaml but not-made-here set in.
no, the stage1 compiler uses llvm so obviously not
I unironically came in here to mention Lua and Rust.
Lua for some game dev stuff that ended up being moved to a more sensible engine, and Rust for some systems programming before I realized it was essentially just C plus those child-proof caps they put on bottles of pills to keep morons from swallowing the whole bottle.
lua's a hue meme but not a memelang, perfect for prototyping shit in love2d
Lua isn't a meme. Lua is used extensively in game dev.
That's the only thing Lua is used for. IMO that makes it a memelang. Although it's used for good reason, to be fair - it's got the best embedding story of any language I know of.
luajit is literally used in CERN
Also adobe lightroom
'memelang' here means the spate of languages trying to innovate in the C space
C replacements
I'd put Rust in there with V, Nim, Hare, Beef, Nim, Odin, Zig, Haxe
Whether a language is a memelang or not has nothing to do with its domain. It just so happens that there are a lot of "C killer" memelangs around. Rust also isn't a memelang. Sorry chuds, but it's actually used in the real world.
'here' -- as in this thread
get back to me when you move up a few esl tiers
It is a memelang.
>"Just have an immutable reference that produces mutable references. It's so elegant! It's not a cope at all!"
What are you talking about?
://doc.rust-lang.org/book/ch15-05-interior-mutability.html
Yes, they are actually called shared references, not immutable references. But 99% of the time it's accurate.
Anon... you reach them through an immutable reference 😐
>Interior mutability is a design pattern in Rust that allows you to mutate data even when there are immutable references to that data; normally, this action is disallowed by the borrowing rules. To mutate data, the pattern uses unsafe code inside a data structure to bend Rust’s usual rules that govern mutation and borrowing.
That specific documentation page confusingly calls them immutable references, but they are shared references.
https://doc.rust-lang.org/reference/types/pointer.html#shared-references-
The reference to the smart pointer is immutable
>self.sent_messages.borrow_mut().push(String::from(message));
self is immutable, yet sent_messages allows you to get both mutable and immutable references, and might panic during runtime if you mess the borrow checking rules which are check in runtime. So it's not just an ugly pattern, it also causes performance penalty
"Immutable reference" is an incorrect term. And it's important that these dynamic checks happen because otherwise it would be easy to produce UB. If you don't want dynamic checks, you can use atomics, Cell, or UnsafeCell (which is the "primitive" of interior mutability).
It's not, self is an immutable reference.
fn send(&self, message: &str) {
self.sent_messages.borrow_mut().push(String::from(message));
}
It is an ugly pattern. Basically all the Cells in Rust rely on the unsafe Cell, and whenever they use unsafe code it ends up in very convoluted and ugly code.
The book is wrong to call it an immutable reference.
>Basically all the Cells in Rust rely on the unsafe Cell, and whenever they use unsafe code it ends up in very convoluted and ugly code.
This is nonsense.
Is self an immutable or mutable reference?
It's a shared reference.
You can make a tree, but if you want backlinks then you need unsafe pointers or safe smart pointers (e.g. Rc).
So?
It's not a shared reference. self in this method definition is an immutable reference.
>So?
So it's nonsense but it's true? 😐 Using unsafe code makes Rust code convoluted and hard to understand, because it's basically a hack around the borrow checker.
Calling it an immutable reference is wrong. Saying "unsafe code bad" is moronic.
pub struct Cell<T: ?Sized> {
value: UnsafeCell<T>,
}
>https://doc.rust-lang.org/src/core/cell.rs.html#244-246
That file isn't really ugly or convoluted.
I think the proper comparison is to C++. Is unsafe Rust code much uglier than (also unsafe) C++ code?
I wasn't talking about that file, but when unsafe code gets abstracted and used, like RefCell, like the snippet I've shared that showed interior mutability.
Fine, it's an immutable shared reference that points to RefCell which generates mutable references. Happy now? It is still ugly af
C++ doesn't need ugly patterns like interior mutability in the first place. So yeah, unsafe C++ looks better than unsafe Rust
You can't really compare "unsafe" code in Rust and C++
Because unsafe to Rust doesn't necessarily mean it's bad or will cause random memory access. Rust rules exclude some correct programs (which are used in many algorithms btw) because it sees it as a better trade off than allowing these correct programs but with the possibility of introducing incorrect ones. So this contradiction makes working with Rust really painful.
>So this contradiction makes working with Rust really painful.
No, it doesn't. I'd hazard a guess you have never (substantially) worked with Rust.
not that anon but what do you consider to be substantial code? rust programmers trial & error until the red squigglies disappear from what i've seen, very productive
How is this even an argument? But fine, let's roll with it. Let's ask someone who actually has a job at Netflix if it's painful to work with or not
He admits he's not good at writing Rust. Who gives a shit? I would never claim that Rust is easy to use. It just eliminates footguns (mostly).
Because he's afraid of rustroons after him. He messed around with rust more than with go, yet he managed to pick up go much easier and faster.
>Also I fail to see what this has to do with unsafe Rust.
You're the one who said that working with Rust isn't really painful, when to do anything useful in Rust you have to use all these abstractions over unsafe code which makes everything convoluted and ugly.
Even the definition of unsafe in Rust is inconsistent. For me, this is a big flaw in the language design. Calling safe programs unsafe just because. TypeScript doesn't have this problem. the any type is literally an any type. It doesn't have this dumb inconsistency and muddled thinking and definitions
Also I fail to see what this has to do with unsafe Rust.
Nobody calls RefCells elegant, they're just an escape hatch you need every once in a while. Not that remarkable. Far from the biggest problem Rust has and no worse than many of the problems other non-memelangs have.
Cell is zero-overhead and pretty clever.
The locks and atomics are great.
So-called "immutable" references are shared references. "Mutable" references are unique references.
self is a shared reference.
Read this: https://smallcultfollowing.com/babysteps/blog/2014/05/13/focusing-on-ownership/
If you want backlinks you need either unsafe code or runtime bookkeeping with reference-counting and whatnot.
Implementing data structures in Rust unfortunately isn't very easy. But on the other hand you can design a safe interface so that users of the data structure can't mess it up.
I've seen a big enterprise software that used luajit as a sort of DSL for domain experts to write rules in.
Yeah I tried Python
yeah, i use beef extensively
Does zsh count as a meme
yeah, I used Nim for some time and enjoyed it. Still needs some work however
Elixir and Rust, enjoyed both. I fricked over 100 troony and twinks in my lifetime.Caught only chlamydia but cured it with a single pill.
nim and it's great, just needs libraries
>lua
why do you guys keep getting baited
omfg get new material
I don't have enough time to frick around with memes. I've always wanted to build something with Haxe though.
I used crystal to generate a tool that formats documentation for my job.
Yes, Zig. It's nice actually.
is forth a memelang or some kind of suicide mission?
nim is nice but docs seem shitty to me. I don't know why but navigating their docs and figuring out how to do something is really hard work. For example lookup how to do async its really convoluted like half the docs are missing.
Haxe is nice very nice if the compile times weren't so long. 2s for a basic hello world just sucks. A c++ similar program compiles in ~0.1s.
If any of you anons are into math, you should check out lean4, big brains are using it to formalize mathematics.I tried to work through the tutorial, but had to drop it because of lack of free time. Seems very interesting tho.
Zig is only nice for having a very portable C/C++ LLVM toolch-
>have to recompile EVERYTHING to avoid linker errors
No, I have a job.
tried zig, can't stand its autism of error out on unused parameters
>a tool I use literally every day in my workflow "rewrites in Zig"
>its supposed to be 100% compatible drop in replacement, version written in C is no longer updated
>its 5% faster, but crashes if a filename has invalid unicode
>makes it completely unusable, since I process millions of random files daily
I hate memelangs now. The tool is ncdu.
are you sure?
Yes. Running ncdu v1 completes on my dataset. Ncdu v2 crashes after about 6 hours with some Unicode error.
6 hours?
Yes, it usually takes around 12 hours to do the whole thing.
Its 230+TB across 18+ million files of porn. Somewhere in there, some filename crashes zigged ncdu.
Proof, the ncdu listing I generated for my last backup (after compiling v1)
Did you try to figure out which files kill it?
No, the generated file always ends in a different place, and it takes 6 hours to narrow down a bit. I looked into opening a bug report but they're not on github for hipster reasons. I'll probably just send an email
Just edit their code to log the files it is looking at somewhere.
to be fair, nothing handles unicode and any attempt is futile
datasets are big or nothing.
Sounds like a (You) problem
Not handling Unicode means you don't care about malformed UTF-8.
Adding proper Unicode support means you'll handle valid UTF-8 better but you also have to address invalid UTF-8 somehow. The laziest way is to crash, slightly less lazy is to clean it with replacement characters. The proper way is to actually fall back to processing byte-by-byte but many people don't do this.
Rust has an overwrought system for invalid unicode called OsStr (which also does UTF-16 on Windows), and third-party libraries for other approaches. I don't know how Zig does things.
Perl one liners are allright under the scope they were created for and i think is way too demonized. If we strictly had followed the "nuke ill suited square in round pegs" principle Javascript would've died a long time ago (as rightfully should've).
I don't consider V a meme
V is the only actual meme
>networking API calls curl, not uses libcurl, calls curl
Meme
V is a piece of shit
Why?
V is the memeiest language of all. You have to be a complete idiot to fall for anything the creator says.
I tried go. having a compiled C-like lang where unicode just werks was nice
but it had too many things that triggered my autism. like the package import nonsense, enforced formatting, unused vars being compile errors, etc. just shut the FRICK up and let me program
also got tired of typing if err != nil and _, everywhere
still a decent lang I might use it some more some time. it seemed good for webshit
Zig is ok. I've been doing C guides with Zig, for example the build your own text editor thing.
i kinda liked odin but i'm with the bnuuy now
Haxe was pretty comfy I guess
Nim is awesome. I pretty much use it as a drop in replacement for python.
I'm going to try Zig this weekend. I rejected V because its maintainer appears to be an amateur who handles criticism poorly, and Nim because I don't think it's really suitable for the same niche as C (it has a weird mix of low-level and high-level features, such as five optional garbage collection strategies).
>tfw no Julia mention
Sad.
I've read a fair bit of Haxe.
Zig, Nim, Odin, V and now Carbon have nothing to provide me that Go can't.
Haxe is super interesting to me because it could conceivably become a proper cross-platform game engine basis similar but more portable than dotnet/C#.
>Haxe
already is with something like heaps io?
I know about heaps, it's how I played Dead Cells on OpenBSD, but to be "proper" cross platform to me that is possible with Haxe/Heaps would require two more generations of hardware with the current day ones still supported.
I'm saying Haxe has the possibly to kill remakes/remasters dead and you simply ship a new build of the exact same game to new customers who would trivially play multiplayer games with someone on 3 generations behind.
Rust is such a memelang it can't implement a graph lmao
>https://stackoverflow.com/a/28622326/18682208
>"Graphs are le bad! Doubly linked lists are le bad!!"
Forth on stm32
for me, is massively overtemplated c++ on already overtemplated mbedOS so compile times lets me go home early
>so compile times lets me go home early
I work remotely so its freertos/zephyr and c99 most of the time
rust is more trouble than it's worth for anything I'd want to work on
I like nim but I don't like writing nim
zig is comfy but it's still too undercooked
if zig makes it to 1.0 with some of the proposed features I'll make the switch
Strange that these two threads were next to each other