beznaděj та kernel panic 𔒏𒀱
89 subscribers
165 photos
14 videos
7 files
152 links
безнадей та кернел паник
тематики нет и не будет. но мне нравятся языки и компьютеры.
більш інтелектуальне: @hokumon
Download Telegram
Forwarded from ilo sona
Forth is incredible. In 300 lines of code, I am able to make a RISC-V32I assembler and use it to boot into OpenSBI with Qemu. Not to mention, a significant amount of those 300 lines are data definitions like register names and instruction definitions. The core of the assembler—the infrastructure for encoding and decoding instructions, and dumping them into a binary file—took a surprisingly small amount of effort. Whether this speaks to the strengths of FORTH or RISC-V is not a question as I tried to do the same thing in C and I had gotten to about a thousand lines and am still writing a parser. Even then, if i had completed it, it would be a much less powerful assember as compared to the one you see in the screenshot above which is an assembler written as a forth DSL, giving you all the power of forth to write your assembly.

https://en.wikipedia.org/wiki/Forth_(programming_language)
https://en.wikipedia.org/wiki/RISC-V
https://github.com/riscv-software-src/opensbi