Post B6g2ewztxX3xg0d1we by vii@dsmc.space
(DIR) More posts by vii@dsmc.space
(DIR) Post #B6RNGYt4eaAmFmUtrU by vii@dsmc.space
0 likes, 0 repeats
okay, okay, okay, it works I can’t believe it fucking works I didn’t even set out to do this this is a side effect of having a forth-like repl for playing with the vm directly but… genserver.I’ve implemented a genserver with the VM and it works. { 0 1 | ; arity 0, 1 capture counter body load_captured 0 store 0 ; @init: state := captured 0 recv_peek 20 ; @loop: empty mailbox → @park store 1 ; msg: local 1 load 1 is_tagged_tuple 16 4 :call ; not :call/4 → @retry pop recv_remove load 1 tuple_ref 1 ; from-pid :reply load 1 tuple_ref 2 ; ref load 0 1 + ; new-state = state + 1 dup store 0 ; state := new-state tuple 3 ; {:reply ref new-state} send pop ; deliver to from-pid jmp -20 ; : @loop recv_advance -21 ; @retry: skip msg → @loop recv_wait -22 ; @park: block: @loop } spawn ; spawn the counter, push its pid make_ref store 1 ; ref: local 1 dup ; keep pid for later :call self load 1 :inc tuple 4 ; {:call self ref :inc} send pop ; deliver recv_peek 5 ; @wait: empty: @park store 2 ; reply: local 2 load 2 tuple_ref 2 ; extract n recv_remove jmp 1 ; : @done recv_wait -7 ; @park: block: @wait ; @done: stack = [counter-pid, n]and the equivalent ish code:fn counter state do receive do {:call from ref :inc} -> do new-state = state + 1 send from {:reply ref new-state} counter new-state end endendfn main do pid = spawn (fn -> counter 0) ref = make-ref send pid {:call (self) ref :inc} receive do {:reply ^ref n} -> n endendGUYS. GUYS. YOU FUCKING GUYS I HAVE SOMETHING.
(DIR) Post #B6RNGZSWWmWs1j5D7I by w0rm@dsmc.space
0 likes, 0 repeats
@vii imagine, simple scripts, way more comfortable, and fuck default shell users. Explicitly not Ubuntu friendly.
(DIR) Post #B6RNGZdVrvJsZoDzFI by w0rm@dsmc.space
1 likes, 0 repeats
@vii We have 2 more slots on tier 0 network ( thank you, @p ) The rest is my unmanaged hubs because something something a cheap bitch.Anyway gonna put NAS on there. Last slot could be the singular web node for your cluster.
(DIR) Post #B6RNJed5lDTIvoUqbg by p@fsebugoutzone.org
0 likes, 0 repeats
@w0rm @vii :bigbosssalute:
(DIR) Post #B6g2dylzs6I0tVf4wS by w0rm@dsmc.space
1 likes, 0 repeats
@p @vii I put the NAS there. Last port is yours, @vii.
(DIR) Post #B6g2ewztxX3xg0d1we by vii@dsmc.space
0 likes, 0 repeats
@w0rm @p So soon.
(DIR) Post #B6g2exAXJzZOCzbWWO by w0rm@dsmc.space
1 likes, 0 repeats
@vii @p It's 4tb ssd for fse, and another 4tb ssd for dsmc stuff, finally there's an 8tc of spinning rust. For general use.
(DIR) Post #B6g2g6Kwil5Evq1L6W by w0rm@dsmc.space
1 likes, 0 repeats
@vii @p 8tb*