extrafora

@extrafora@mastodon.gamedev.place
5 Followers
93 Following
127 Posts

I miss those bottles of Modelo Especial which bore the inscriptions

DRINK SENSIBLY CONTAINS MALTED BARLEY

and

BEST BEFORE SEE BOTTOM

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?

"Ah yes, see, computers are made up of lots of parts, but the most important one is the GPU, the General Processing Unit, which often shares memory with the CPU, the Control-Flow Processing Unit—"

#misinformation

@zachleat new captchas just dropped
@jwz in these trying times:

What a week, uh?
Captain, it's grmffnesddy

#whataweek #grmffnesddy

×

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 the key thing to notice is that you implemented println as a builtin :P
@domi
> bread 1 tag
Ah yes, bread every day
@domi Almost wish it would be POSIX / Korn Shell because it would be a completely ridiculous way to bootstrap OpenJDK from source…
@lanodan i’m using a self-made library for most accesses, so it wouldn’t be that much work to backport it afterwards… for now i’m gonna work on more opcodes tho :)

@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 @sertonix eeeeeh what the fuuuuck

@lanodan @sertonix correct reaction :D

0x01 is used as a special value somewhere internally and IFS FUCKING LEAKS INTO THAT

i haven’t gotten to the bottom of the bug ( @mei has done more digging tbh) but i absolutely adore this little thing

@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 `if you're seeing this, your browser may be rejecting cookies.`

@waldi enable javascript or set the cookie LANG to any value

will modify to not require JS at some point, didn’t have time

@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

@asltf nah, i did it myself :p
@domi bober kurwa
@lunch @domi I really want to believe it's a part of the JVM spec
@creepy_owlet @lunch yeah just don't check it. it's in chapter 4 (JVM) part 2.1.37 Suspension of Disbelief
@domi
Minecraft java in Bash when? /s
@domi is it going to be a minecraft server in bash again, but the unexpected route?
@ar a *lot* of extra code glue would be required, I don't think I have enough time  but I definitely want to go a bit further with this :3
@domi @ar I know a cool Java 1.8 based ebics client that can crash macOS ;)
@domi why not arithmetic first?
@domi fedi is the last refuge of people doing fun weird computer stuff
@domi new hello world string just dropped
@domi Hold my beer imma make it work on embedded python.
@domi does that footer actually work? i would have expected a lot of scrapers from china to be state owned and could bypass firewall restrictions.
@domi uh i meant on your git.. i meant to reply to the one where you link it. this is cool btw
@lynn uncertain, but i keep it there for funsies

altho the cookie thing DOES keep the spammers out (i serve a static page that sets a cookie and refreshes, then nginx lets agents with that cookie through)
@domi oh i was wondering what that was at the beginning
@domi how does one set this up, im asking for a friend

@lynn

map $cookie_lang $limit { "" ""; default "ok"; } map $http_user_agent $what { "~git/.*" "ok"; "~[Gg]o-http-client.*" "ok"; default $limit; }

then inside server directive

if ($what != "ok") { rewrite ^ /nope.htm break; } location /nope.htm { root /var/lib/forgejo/webroot; }

and the file itself

<!DOCTYPE html><html><head><meta charset='utf-8'></head><body>if you're seeing this, your browser may be rejecting cookies.<br><br>if this persist, contact scrape@sdomi.pl<script>document.cookie='lang=en-US; path=/';window.setTimeout(()=>window.location.reload(), 150);</script></body>

FYI: you can do this without JS, and I plan to rewrite mine to just show this page, set a cookie, do a refresh through meta, done.

@domi@donotsta.re i fear what you have planned for the function ops
@domi oh what the fuck
@domi it is now tempted to implement python bytecode execution from bash now
@domi oh no. its previous project of compiling python code to bash builtins would make this really easy, it thinks.
@domi the fuck
congress talk when?
@domi you put this together scarily quickly
@domi the easiest way is just writing an AVR emulator in bash with virtual SRAM attached via I/O pins, then writing an x86 or RISC-V emulator and compiling to AVR, then using OpenJDK...
(finally, speed measured in 'seconds per instruction')

@domi This is exactly the sort of utter, chaotic nonsense that I love seeing.

I approve.

@domi minecraft in bash when 
@domi So a kind of jbang?