it lives!  JVM in Bash

for now it only has ~5 opcodes implemented, and one virtual method (println). So this is literally the minimal amount of Stuff to get a hello world working

next up, conditionals?

for all the “yeah sure” people, code here
@domi Almost wish it would be POSIX / Korn Shell because it would be a completely ridiculous way to bootstrap OpenJDK from source…

@lanodan @domi

You could write a bash shell in posix shell with only the needed features

(I never finished my posix shell in posix shell project so unfortunatly not useful here)

@sertonix @domi Well issue with that is GNU is typically awful at even just well documenting their programs so it would mean a lot of either gnu-source spelunking or reverse engineering…

@lanodan @sertonix bash has a lot of bugs. i’d argue that if you don’t implement all of those, it’s not Bash, it’s bash-like

for instance, my favorite way to split a string into characters:

IFS=$'\x01' echo "meow"$asdf # $asdf has to be nonexistent

@domi @lanodan

Wha-

apk add !bash

@sertonix @domi Sometimes I wish I could toss out bash from my gentoo machines… but by spec gentoo ports tree depends on bash.
@sertonix @domi *puts on UNIX®/POSIX certification hat*
Also… I wonder if that's even UNIX®/POSIX legal, would be kind of fun to be like "Nope, bash isn't conforming due to it's IFS=$'\x01' behavior"

But well too lazy to check the spec on my free time.

@lanodan @domi

I have seen POSIX specify behaviour based on bash even though it contradicts with *BSD and busybox shells so I fear things might change in the wrong way when someone rases that issue.

@sertonix @domi Yeah, I don't think everything added into POSIX is checked against *all* implementations, there's too many of them (and some are either proprietary or OS-dependent).
At least participation is open so implementers can chime in, and usually they do.

Plus well few like dash usually aren't worth checking out due to them trying to avoid extending on POSIX (which can be rather annoying, like dash badly needs a release now that POSIX.1-2024 is out).
And BusyBox… quite few times it doesn't even meets the baseline of prior POSIX releases or stuff that was common in say both SVR4 and 4.4BSD.
@sertonix @lanodan you’re gonna break world, bash is a dependency of a surprising amount of packages :D

@domi @lanodan

(I don't have it installed)

I will add that to the list of packages which people tell me that I can't live without but do anyways 🙃

×
@domi 🤨
Was ist das denn?
@asltf a good omen against chinese bots /hj

@domi Ah, so it is some sort of protection against bad actors from behind the great firewall?

Ok, thought it was hacked