[-] ChubakPDP11 1 points 1 day ago

I know about all this


I actually began implementing my own JVM language a few days ago. I know Android uses Dalvik btw. But I guess a lot of people can use this info; infodump is always good. I do that.

btw I actually have messed around with libgcc-jit and I think at least on x86, it makes zero difference. I once did a test:

-- Find /e/ with MAWK -> 0.9s -- Find /e/ with JAWK -> 50s.

No shit! It's seriously slow.

Now compare this with go-awk: 19s.

Go has reference counting and heap etc, basically a 'compiled VM'. I think if you want fast code, ditch runtime.

[-] ChubakPDP11 1 points 1 day ago

I was mainly asking if this was even the case. If i go to the maintainers and say shit like this they b& me.

[-] ChubakPDP11 1 points 1 day ago

1- Not sure, I can't read; 2- Yes, Fish; 3- Yes, it fixed it.

[-] ChubakPDP11 6 points 1 day ago

I think that happens when app developers learn2optimize. Stop using interpreted bytecode languages on small processors!

[-] ChubakPDP11 16 points 1 day ago

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

[-] ChubakPDP11 0 points 1 day ago

I posted my history as a response to @Technus. I know about --no-install-recommends but that's an apt(1) switch. How can I do that with dpkg(1)? Check my history, I've been building more than I have been installing lately. Like, for a long time I have been looking for a 'useful' language to make, and then I remembered that there's a swath of programmers in my country who are addicted to Delphi, and Nkki W. has not pushed to Pascal upstream since 1974. So I decided to host a Pascal on JVM. I made ANTLR. But then, it kept complaining that some targets fail, so I had to remove them from pom.xml. I myself am new to Java toolchain tbqh. I think one language that most people build from source is NodeJS. NodejS toolchain is not as good as say, Ruby's or Guile's, but it's good enough and easy to use.

Thanks.

[-] ChubakPDP11 -2 points 1 day ago* (last edited 1 day ago)

Podman, gotcha. I am freaking tired of these Docker-esque companies. They use their status as a FOSS application to grift people. As if it's really 'hard' to do what Docker does! It's just mixing a namespaces(7) with cgroups(7), some other stuff too, like seccomp(7). Hashicorp is one of these companies, I think you know, it went entirely closed-source a few months ago. But truly, what is so 'complex' about a secure hashtable database? GNU has one! You can use libcrypto + libtokyocabinet to make one in matter of hours. I think the issue is, most sysadmins, especially old ones, are either clueless about systems programming, or if they are, they are just too lazy to roll their own. I'm not saying 'roll your own', I'm saying, you don't necessarily need super-stable software. Companies like Hashicorp and Docker find giant customers with rich pockets, e.g. AWS, either that, or some degenerate Black-Rock-esque corporate buys them out and you know, I don't wanna prescribe anything to Americans because I don't wanna be the pot calling the kettle black, but damn, imprison those damn investment bankers! They don't understand that closed source doesn't necessarily mean 'more moola'. What it means is more obscurity, more trouble finding bugs, etc. The closed-source software died fucking ages ago. Even Micrsoft open-sourced DOS, most likely they will start open-sourcing 9x and then NT, or at least, release Windows' specs; pretty soon. Say whatever about micropeni$ but they produce more FOSS these days than closed-source software! E.g. VSCode, Terminal, TypeScript, etc (I don't use any of them, but I appreciate the gesture!).

Sorry for the rant.

[-] ChubakPDP11 0 points 1 day ago

I posted my uname -a, it's Pop_OS!, Debian-based but not Debian. My kernel is the latest version, I just did a fresh install and did a dist-upgrade (uname -r says 6.8.0-76060800daily20240311-generic).

Here's my entire command history since I installed this one a few days back (I got nuthing to hide!)

https://pastebin.com/biThVQME

So if you guys really think there's something fishy here, please do something!

78
submitted 1 day ago by ChubakPDP11 to c/programmer_humor
4
submitted 1 day ago* (last edited 1 day ago) by ChubakPDP11 to c/linux

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 not be caught dead using.

So is this accidental, or another predatory move by one of these 'ooh I wish I did not open source' companies (e.g. HashiCorp)? Why don't we all use LXC and ditch this piece of shit?

I could be misunderstanding how Debian-based packaging works. But this is too '''accidental'''. Correct me if I am wrong.

uname -a for context:

Linux pop-os 6.8.0-76060800daily20240311-generic #202403110203~1714077665~22.04~4c8e9a0 SMP PREEMPT_DYNAMIC Thu A x86_64 x86_64 x86_64 GNU/Linux
[-] ChubakPDP11 0 points 1 day ago

Hey now, I am just a yokel from Mazar-Sharif, New York who sells dingbat carcasses for infant consumption, but does Android even use JVM? I was under the consumption it uses Dalvik? Let me consume a dingbat -- ok, so who cares what "java" gets compiled to, JIT, AOT even tree-walked, we're talking about JVM here. Here: https://sourceforge.net/projects/jasmin/ An ancient JVM bytecode assembler.

0
submitted 2 days ago by ChubakPDP11 to c/webdev

This is nice huh? I remember there was a dude here who wanted to make a language called 'ParenScript', I don't know if he wanted to make it Scheme compliant or not but this is a good resource for inspiration.

Many people hate on JS for its syntax, I don't exactly know what is wrong with JS' syntax


it's just a Fortran-derived syntax. But these people have no reason to hate it if they use this


Unless they hate S-Expressions too? Then I guess they're just chuds lol.

Now this does not have syntax-rules, which is a pity but I guess the old macro system is good too (define-macro). Keep in mind that these macros, like Mike Rotch, are not hygenic. Meaning if you name something foo in the macro's body, and there's another thing named foo in the closure the macro is invoked at, they will conflict.

Thanks, enjoy.

13
submitted 2 days ago by ChubakPDP11 to c/rust

Over the years, up until Rust, there were 4 ways to have a 'safe' language:

  • A virtual machine (e.g. most languages today)

whether it's a high-level (scripting languages) one or low-level one (JVM, CLR)

  • What C++ and similar languages do, destructors, compile-time bound checks, make a global heap and shit in it, make a local stack and piss in it, etc (basically my AllocPPx.pl but baked into the language)
  • Bake the VM in with the machine code. That's what D and Go do, and I think Nim does that too. This will make the point of your language being compiled entirely moot imo.
  • Finally, the most 'controversial' decision for imperative-loving chuds: make a functional language. ML/Scheme/CLisp achieve memory safety through closures. Haskell achieves this through Monads. Functional languages have a property which allows them to be be both compiled into machine code and bytecode, and also, interpreted like an scripting language.

The problem with all these approaches is the trade-off between safety and speed. There's another factor, and that is low-level access to the system. Languages like OCaml came close to achieving a balance, and that's why Rust bassed itself on it.

Most imperative languages have 'operational semantics', but not 'denotational semantics'. You can't describe what C does with math. What C does depends on the platform, the CPU, etc.

Rust's safety is achieved by 'flattening out' the memory model of a functional language like Ocaml. OCaml is a language with denotational semantics, because it's a functional language. Rust is an imperative language but it has denotational semantics. At least when comes to memory management.

I am not going to even attempt to describe the denotational semantics of Rust because I am just an amatuer and i don't have a master's in LDT. But if someoen tries, they could.

I think people might have already done it. I am not sure.

If you tell me no, and Rust does not have denotational semantics, I stand by my great-great grandfather's barber's grave that yes, it does!

So why do I say Rust 'flattens out' the functional model for memory management? It does at least with lifetimes. So imagine this: lifetimes are just 'let' bindings, but with a different syntax.

OCaml:

let rec factorial = function
  | 0 -> 1
  | n -> n * factorial (n - 1);;

Scheme

; This uses `let` under the hood
(define (factorial n)
  (if (<= n 1)
      1
      (* n (factorial (- n 1)))))  

So these two in Rust would be:

fn factorial<'a>(n: u32) -> u32 {
    match n {
        0 => 1,
        _ => n * factorial(n - 1),
    }
}

I know 'a is almost useless here, but what I meant was, that 'a makes it similar to the 'let' bindings in the prior to examples!

Semantics here is clear. Right?

But C:

int factorial(int n)  {
   if (n == 0) return 1;
   else return n * factorial(n - 1);
}

We do have operational semantics here, but who's to say what are the denotational semantics? Right? What is a 'function' in C? Well most C compilers translate it to an Assembly subroutine, but what if our target does not support labels, or subroutines?

You see what I am arriving at?

Conclusion

Rust is a semi-functional, semi-imperative language, but the difference between Rust and other languages with functional aspects is: denotional semantics!

Note: A language having lambda closures does not make it 'functional', you can do that in GNU C too ffs! Denotational semantics make it functional.

6
submitted 2 days ago by ChubakPDP11 to c/c_lang

TCC fails with GNU's regex.h:

echo '
                                              #include <regex.h>

                                              int main() { return 0; }' | tcc - -run
In file included from -:2:
/usr/include/regex.h:682: error: '__nmatch' undeclared

Would building it from source fix the issue? I know from my experience that Pop_OS! apt repositories are not very up-to-date with smaller apps. For example, NekoVM is from 2017, the latest one is from 22 I believe.

57
submitted 2 days ago by ChubakPDP11 to c/rust

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 author says it can JVM code from Clang output, so why not Rustc?

Keep in mind that these are two different beasts, JVM is designed for a safe virtual machine and LLVM is chiefly used to be translated into machine code. However, stupider and more wonderful things have been done with LLVM and JVM, for example, there's an LLVM to 6502 translator, so you could be making NES games with Rust.

I will test this in a few days, busy implementing my own JVM (hope I can do it) and I don't have the Rust toolchain installed on my system. But hey maybe someone can make a Cargo plugin from it (is it possible?)

Thanks, later.

20
submitted 5 days ago by ChubakPDP11 to c/programmer_humor
[-] ChubakPDP11 1 points 5 days ago

Cool, will do.

5
submitted 5 days ago* (last edited 5 days ago) by ChubakPDP11 to c/programming

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.

You can install it via:

sudo apt install epiphany-browser

Make sure you add the -browser, otherwise some shitty game that crashes your system is installed. DO NOT RUN THIS GAME! This is not a joke.

Of course this only works for Plebian-based systems. Other package managers may, or may not have it.

So as I said, I had a lot of issues navigating. I was experiencing network isseus at the time. Tried it again when they were fixed. SLOW AF!

It's not that fetching www is slow, rendering hypertext is slow as well. Lik, I monitored tcp/443, it got done fetching the text and it was STILL struggling to render!

Soo... 'render' is the key here. It's obvious why it's slow. It does not use Direct Media Access.

But that does not mean it's useless right?

I can imagine lots of uses for web automation chuds. Basically bind libwebkit2 to Python and you'll be free of automation protocols. Although it does support automation protocols as well.

In fact you can use wpewebkit-driver to interace with Epiphany's web driver. Good thing about it is, the protocol hackable af.

sudo apt install wpewebkit-driver

So anyways, if you did not know about this, now you know.

And I think most people DO know about it, because another browser that uses libwebkit2 is GNOME browser which comes as default X browser on most Plebian systems. I don't think anybody uses it though. It's kinda like an extremely un-intrusive IE6 lol.

Thanks.

[-] ChubakPDP11 1 points 5 days ago* (last edited 5 days ago)

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.

[-] ChubakPDP11 1 points 6 days ago* (last edited 6 days ago)

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.

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.

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.

EDIT 2: The FFI could prove to be much more complex than I thought? There's libffi though.

7
submitted 6 days ago by ChubakPDP11 to c/linux

So I want to implement my own ROFF. I collected this to have a database for me, and everyone else, about ROFF, especially GROFF.

No-lifes at BSD are trying to push away ROFF in favor of Mandoc. I say booya to that. I will implement a 'new new roff'!

Anyways I hope you enjoy this series of documents and datasets. ROFF is really, really sweet. It's the reason we have UNIX.

RIP Lorinda Cherry, she's the author of eqn and passed away not long ago. When I saw her on the UNIX internal documentary I thought she's a secretary


and I hope you forgive me since 1980s CS was not exactly a knitting circle.

Ossanna was also a key developer of ROFF. He died not shortly after it was developed.

You can find some blog posts of people reminiscing about using GROFF 'mom' package to format their essays and dissertations even! Kinda jelly. I guess when your first PC you are given at 12 has MS Word 2003 installed on it, you don't think much about DSLs for typesetting. I wish I had something to typeset :D

Thanks.

26
submitted 6 days ago by ChubakPDP11 to c/programming

So we have all these control characters in ASCII and besides newline, horizontal tab and carriage return (on Windows) the only use for them is on terminal emulators (which I am making one!) Also as an extension, us NeoVim/Vim users have extensive use for them.

But all these control characters are 0-31, for example, newline is 10, horizontal tab is 9, carriage return is 13, etc. But DEL is aaaalll at the bottom, the last one, 127!

Here's my theory. So, DEL is supposed to delete one row of text, it's backspace that is supposed to just delete one character (I think backspace is 31?). So since 127 is literally 7 1s, marking it on a punch-card 'by mistake' would be kinda hard right? So you want have delete ruin your batch. It's kinda like a built-in 'Are you sure you want to delete this row of punch-card?'

Now I could be wrong. Opinions?

PS: If this is so, this kind of 'physical sentinels' is nothing new. According to Alan Kay, the earliest linked lists were not data structures, THEY WERE 1-TONN MAGNETIC DISKS! So basically, you had the address, and by 'address' I mean the physical address, a real location on planet earth, of the next magnetic disk stored on a fixed location on the previous magnetic disk. Fun huh?

12
submitted 1 week ago* (last edited 1 week ago) by ChubakPDP11 to c/linux4noobs

Problem is it can't find mkdev.h:

cpio.c:101:10: fatal error: sys/mkdev.h: No such file or directory
  101 | #include <sys/mkdev.h>
      |          ^~~~~~~~~~~~~

Now a UNIX system, especially both POSIX and SuS is impossible without mkdev.h


at least a shitty wrapper. And when I googled mkdev.h to see the specifics the first result was an LXR.

WHY DO MY SYSTEM HEADERS DON'T HAVE A BASIC UNIX HEADER FILE THAT LOONIX HAS? (OR HAD)

Problem is I really wanna make Heirloom. I whole-heatedly disagree with GPL because RMS drinks children's blood. I refuse to use free software and in fact I use Pop_OS! which has more binary blobs in it than a 80s musical composer for Disney movies has had dicks in him. Heirloom is based on Solaris' utilities and they are unfree as my semen is to super modles. I WANT THIS.

joking aside, what is going on here?

ls  -R  /usr/include/ | grep mkdev

Exits with 1. Nothing.

So I guess this is a Pop_OS! thing? Should I install some package to get this header?

Or was it removed from 6.8?

uname -r
=> 6.8.0-76060800daily20240311-generic

Thanks.

0
submitted 1 week ago by ChubakPDP11 to c/gamedev

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 vidya?

So hear me out. We need to make common runtime VM for vidya. Standardized. And it will sport a post-fix language like PostScript. You can learn more about PostScript here.

PostScript is the predecessor of pedophile language, like cat a PDF file and you'll see. Except pedophile language allows of binary blobs. PS does not. There's a lot of differences.

Pedophile and PS are 'page description languages'. Another PDL is ROFF, what UNIX manpages are written with. Launch loonix via WSL2 (I know none of you game devs run loonix natively! You won't be able to work!) and bring up a manpage like man awk. ROFF was why UNIX was written!

So I say, let's make a 'vidya description language', you could just use PS itself with addition of:

  • Input
  • 3D shapes

And Bob's your uncle (am I using this phrase correctly?). PS is a Turing-complete language, it has control structures and you can make a 'game play loop' with it (basically a non-halting decidable TM).

So this language will execute on a runtime VM, a stack VM of course, and this VM is common across several hosts. Just like Java's VM. In fact, Java's VM is already a 'common runtime vm' for vidya right? This time we'll have something more specific.

So this VM will execute the same VDL (Vidya Description Language) code the same across different hosts. Linux, Windows, MacOS, Haiku, Solaris, MacOS, Plan 9, BeOS, BSD, iOS, Android, FireOS, etc. Also it could target various APIs e.g. Meta, Vulkan, OpenGL etc.

I know Unity already has such runtime. But VDL and VdlVM will be more of an 'standard'. In fact, we would develop the 'standard'/specficiation first, then we'll develop the software. We would make one implementation, but someone else could make another implementation, both compliant and compatible! And our implementation of VDL and VdlVM would be FLOSS, released under GPLv3


but Johnny Schlomo can make a super duper closed-source implementation!

So you may look at PostScript and say, damn man, I can't code in this language! Well my good man it's not meant to be coded in directly. That's what I mean by 'assembly of vidya'. It's a language other engines and runtimes target. This is called a 'terese' syntax. The aim of a terse syntax is to have non-binary ASCII text as a portable way to move your code around. In fact, VdlVM does not need Vdl to function. VdlVM reads from binary cishet files, not directly from Vdl files.

Thoughts/critiques/appendages? Would really like to know what you think of this idea. I would implement thi,s, but as I said, it's an standard. An standard needs a community. An standard needs a publicity. An standard needs design. This is not a one-man job. If you would like to develop this standard with me, let me know (chubakbidpaa [at] riseup [dot] net). We can make a mailing list (Discord is for babies!).

Thanks.

view more: next ›

ChubakPDP11

joined 3 months ago