Conversation
Notices
-
pistolero (p@fsebugoutzone.org)'s status on Monday, 17-Jun-2024 08:09:53 JST pistolero @m0xee @realman543 @iska
> they are now "meme" languages,
Well, you say this, but I wrote an ad-hoc assembler in a Forth a couple of years ago because it was faster to fire up a Forth and look at a chart and emit the instructions I needed than to track down an assembler that would handle the weird shit I was doing and also run on my machine and then get it to compile. 30 minutes: program's done, blob's produced, anyone else would still be stumbling through search results and reading the README in someone's Github repo to see if it even targets the right chip. It's wonderfully expressive, the code comes out compact and readable, and if you're doing a "real" Forth on a small system, you can save a lot of memory: 40 or 50 bytes of opcodes turns into three two-byte addresses.
All the way on the opposite side from bitbanging on tiny machines, I have embedded stack-based languages in applications to use as DSLs for scripting. One of these was just internally facing, but it cut the length of most of the endpoints to two lines, one to extract/escape the user-supplied parameters and one to invoke the little runtime with the generated program and get the results out.
It's not even rocket-surgery stuff, it's easy stuff to do if you've done it once, but if you think it's a meme, you won't try it the first time and it's a tool you'll never have.
Same goes for Lisp; I've used it less often but it's a nice language. (Lisp-1s like Scheme, anyway; I don't like the separate function namespace stuff CL does.) I wouldn't wanna use Lisp as an entire environment if I could use Forth, but it'd be serviceable.
...Not on Itanium.
these_things_are_real_i_do_not_make_them_up.png- † top dog :pedomustdie: likes this.
-
m0xEE (m0xee@social.librem.one)'s status on Monday, 17-Jun-2024 08:10:55 JST m0xEE @p
Oh, for this stuff — sure! I'm currently reading a book, that touches systems programming in examples, and it gets explained how CHIP-8 works, how instructions are decoded, how arithmetics works, how calls work, the author goes on to explain how memory management works, what endian-ness is (for those who don't know it).
Weird shit is — it's a Rust book and all examples feel… AWKWARD to say the least, everything is wrapped in unsafe {}, system calls are used directly, etc 🤪
@realman543 @iska -
pistolero (p@fsebugoutzone.org)'s status on Monday, 17-Jun-2024 08:10:55 JST pistolero @m0xee @realman543 @iska Wonder why a person would do that in Rust. -
pistolero (p@fsebugoutzone.org)'s status on Monday, 17-Jun-2024 08:10:56 JST pistolero @m0xee @iska @realman543 Actually, now that I'm looking at that code again, some of this is kinda cool. Like, there's $call, so you'd push an address onto the stack and call $call and that would emit a call to the appropriate address. But then there's this bit for forward calls and it's kinda clever, it works the same way you would do it in Forth, it leaves a little gap in the memory and then leaves an address on the stack, pointing to the place where the mark is supposed to go, and when you know what address it's calling, you write it to the address on the stack. This is fun shit.
that-s_kinda_clever_i_do_not_remember_doing_it.png -
þernia (pernia@cum.salon)'s status on Monday, 17-Jun-2024 08:11:19 JST þernia @p @realman543 @iska @m0xee its freaking safe and cute, p.