ChubakPDP11

@ChubakPDP11@programming.dev

This profile is from a federated server and may be incomplete. Browse more on the original instance.

Making an libncurses fronted for the Fediverse? (For browing Lemmy websites on terminal [emulators])

Can someone please help me understand how one could make his own frontend for the Ferdiverse? It seems like to run on a bespoke protocol, and has HTTP endpoints as well. The help says you can create your own frontend, divorced of HTTP. What I am wary of is the documentation being out-of-date....

ChubakPDP11,

My man we have UNIX because PDP-11 was expensive!

Predatory forcing of circular dependency?

I think —DOCKER— is doing this. I installed based, and userspace(7)-pilled liblxc and libvirt and then this asshole inserted a dependency when I tried to install from their Debian package with sudo dpkg -i. One of them was qemu-system, the other was docker-cli because they were forcing me to use Docker-Desktop, which I would...

I found a tool that allows compiling Rust to JVM bytecode (make JAR files from Rust, if you dare?) (github.com)

I thought this might interest you Rust folk. This is kinda like an LLVM bitcode to JVM bytecode translator. So run rustc with –emit=llvm-ir (I think that’s the flag) and then pass the bitcode image to this program, then get JVM bytecode which you can make a JVM bytecode archive (JAR) from it. Could be an interesting? The...

Has someone made some sort of "Lion's" for this? (DOS source code made public by mini$haft 2 weeks ago!) (github.com)

I mean “Lion’s commentary on the UNIX source”. This badly needs it. Not some first-class grifter Chud like LowLevelLearning who pronounces GNU as “Gee-enn-u” blowing his soy packets all over Youtube’s UDP packets (I actually did a ‘Don’t Recommend Channel’ on him, knows shit and talks big) but someone who...

What happens to FIPS/UNICODE/IETF/ISO/ANSI etc. in a post-US world? (Warning: slightly political)

A post-US world which we are quickly approaching (again, no chud crap, go away) has a lot of complications for standards put forward by regulatory bodies of America, which all countries follow – mostly because when these standards were created, these countries, even the most technologically-advanced (e.g. France) were behind...

Thoughts on the Epiphany Browser? (not Chrome botnet crap, or even FF-based, GTK+ WebKit-based) (+ A good framework for web automation?)

I honestly have issues browsing to even the simplest of non-static pages. I think it’s like, the graphical version of lynx(1) or w3m(1). I think it’s based on X’s browser right? So basically, it’s based on the Open Webkit Standard. It uses the GTK+ WebKit engine. This engine has a programmatic interface....

ChubakPDP11, (edited )

I think by ‘GADTs’ you mean an AST (could be mistaken). In that case, it would not be a bytecode interpreter, it would be a tree walker. In most languages, an AST is translated down to bytecode, and passed to a VM execution engine. How this engine deals with closures is highly compliant on the architecture of the AST.

First, keep this in mind: A closure is just a closure at the higher-level. Job of the AST is to translate it down to ta more abstract form, thus, a closure would most probably be inlined. Otherwise, it will be a global subroutine defined somewhere on the stack. It never makes sense not to inline closures, unless that closure is a ‘hotzone’, e.g. frequently used, in whcih case you should most obviously define as a subroutine, and if possible, JIT.

A VM lke NekoVM has a higher-order, terse IR with which you can handle closures like you do in JS.

Don’t conflate higher-order constructs with intermediate representations. If you are interested to see a VM development in progress, star my RuppVM. Still early though. But i tend to work on it actively.

Thanks.

Should I continue making my own VM, or scrap it for some preexisting solution?

After getting angry at Lua for bugs reappearing after fixing them, and otherwise having issues with making it interoperable with my own language of choice (D), I decided to roll out my own VM out, with some enhanced optional features compared to regular Lua (type safety, static arrays on the stack, enhanced metatables, etc.),...

ChubakPDP11, (edited )

Are you specifying everything beforehand? If not, I’d recommend locking in on an ISA with stack effect pre-determined. Also, minimize as much as you can.

First off: Read Xia-Feng Li’s excellent book if you have not.

Then.

Here are some minimization tips I am doing for my RuppVM. I just began working on it less that 24 hours ago. But the tips are based on over 6 months of off-and-on trying to make a VM, and failing. I am sure this one will take, because of these minimization efforts:

  • Everything is a word: When you are reading the bytecode stream, read word-by-word, and by word I mean machine word. Don’t waste your time on floats, you can implement IEEE-745 floats as a module, it will be good for practice. There’s a good book for it here.
  • No complex datatypes, BLESS!: So I said everything is a word, what about arrays? Structs? Basically, you need to ‘bless’ chunks. Blessing means taking a routine and turning it into a structure, see: Perl.
  • No OS-level threads, BIND!: Just make ‘green’ threads, as I am doing in RuppVM. You can use the FFI to bind them to OS threads.
  • Stop the World GC + Arena Allocation: Don’t waste time on intricate GC, Just do stop-the-world mark and sweep, on arena-allocated memory (see my code).
  • Super Basic FFI: Take a look at my ISA.txt file, look at what I am doing for FFI. You don’t need intricate type mappings for the FFI. Just register a ‘hook’ to an address in memory (or ELF).
  • Avoid JiT/AoT for now: Don’t focus on it at the beginning.

These variables are not exactly portable, but you can use them, abuse them, etc:

  • extern etext -> First address past the text segment;
  • extern edata -> First address past the initialized data segment;
  • extern end -> end of bss

I think there are portable libraries for handling ELFs and PEs. You could also write your own Assembly code for it. For loading functions from files, for the FFI, these help a lot.

EDIT: I looked, there does not seem to be any ‘portable’ libraries for handling PE and ELF with the same interface. I guess ther can’t be, two different beasts.

Another aspect you should implement is a ‘signal trampoline’. This trampoline will help handle signals from the OS, and hook it to your green threads.

Now, don’t take these as gospel. I am sure you know most of these already. But in case there’s new info, feel free to adapt it.

Star RuppVM, I will be adding a lot of stuff to it soon.

ChubakPDP11,

Those are Linux headers my man. mkdev.h is a POSIX header.

ChubakPDP11,

This is egregious. standards(7) says Linux is both SuS and POSIX. Either mkdev.h is neither and I am wrong, or there’s some shit going on because LXRs list it in older versions of the kernel. In fact if you, I mean me, with my Google recommender system cache, search for ‘mkdev.h’, an LXR comes up! Just stupid and egregious. I was looking forward to running them. But see, time’s moving on from POSIX. People are writing cool supersets of these utilities in Rust. Like: fish, ripgrep, fd, exa and oh so many more! Also, Core Utils is entirely useless now. I just got introduced to the ‘Miller’ utility, an AWK-like string processor that, instead of doing line-based, does key-value. There’s jq too. I think I am the ‘new generation’ of terminal users. I am not very young, 31, but when I started using a PC at 10, it was a Windows XP machine — I did not even get to experience the ‘clunky’ days of graphical shells. But it’s been a while now that I am just constantly using Kitty to interface with my system. Barely use the WM. That’s why I have decided to make my own WM that fuses in a terminal but let’s more on or now.

So yeah Heirloom Toolchest is useless. But at any case, you wanna try the original AWK, someone has pushed it to most of the repositories for Debian-based systems. sudo apt install oawk. It’s good if you suck Kernighan’s dick whilst fondling Aho’s balls like I do. But besides historical reasons why use it. AWK was made useless in fucking 1985 when Perl came lol.

My idea for Vdl, Assembly of Vidya: A common runtime VM for vidya, supporting a postfix stack language ---- basically, PostScript for vidya of 'Vidya Description Language', an standardized one!

I began programming when I was 16 and like most people my age (31) it was with some gaming-related DSL. Personally for me it was GML. I made a tetris game which my younger brother played to death but ever since the closest interest I have to vidya is Ncurses and X11. Which makes me think, why is there not such standard for...

A tokenizer for EBNF written in R7RS Scheme | A full dive into EBNF, how it works, and its relationship to Chomsky Hierarchy (gist.github.com)

About a few days ago I posted this, asking for help to implement the parser. It seems like I boomer’d and I forgot to set the Gist to public. This is public (hopefully!). Someone did gave me a link, but I kinda could not ‘parse’ it (get it? get it?). I still would appreciate it if you would give me guidance in parsing with...

LLVM, MLIR (or any ready-made IR) are not a good fit for learners. Roll your own backend pls if you wanna learn (same shit with LP generators!)

These toolchain are created for experts to create industrial-level compilers. Even if you think you got a syntactic design concept that is such hot shit that you can’t wait to get it bootstrapped, even if hell, it proves Rice’s theorem wrong, please, write a simple interpreter for it to prove your syntax works. In fact, I...

ChubakPDP11,

I actually started work on a tool similar to Forth’s VMGEN. It will generate Stack VM’s in several languages leveraging m4, just like Bison. The difference between it, and VMGEN would be that it actually adds GC and threading. Based on Xiao-Feng Li’s book.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • tacticalgear
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • ethstaker
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • lostlight
  • All magazines