The Computer And General Tech Thread - Software, Hardware, Questions, etc.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
I have decided to write a Forthy dynamically-typed scripting language on top of zeptoforth, which I have dubbed zeptoscript. What little I have tested so far seems to be working... with the big exception of that half the time the GC is borked (and half the time it works perfectly)...
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
And now the GC works, and it is already quite functional (e.g. I can do things like declare and use data structures, manipulate strings on the heap, create and execute closures, and like).
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
For all Linux users here: a severe vulnerability has been found in xz, seemingly giving a backdoor into SSH servers. The recommendation is to upgrade as soon as possible.
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices
(Why does phpBB not let me add >5 links here?)
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices
(Why does phpBB not let me add >5 links here?)
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
Damn. This is going to be a long week at work.bradrn wrote: ↑Sat Mar 30, 2024 5:53 am For all Linux users here: a severe vulnerability has been found in xz, seemingly giving a backdoor into SSH servers. The recommendation is to upgrade as soon as possible.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
zeptoscript is coming along well, and is really fun to play with and add features to; now you can do things like
which gives:
Code: Select all
s" baz" 2 >pair s" bar" 1 >pair s" foo" 0 >pair >triple [: { x y } 1 x @+ 1 y @+ < ;] sort [: 0 swap @+ ;] map s" ***" join type
Code: Select all
foo***bar***baz ok
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
I just realized how to implement object-orientation in zeptoscript how I would like to implement it. There would be no superclasses or subclasses, just classes implementing methods instantiated into objects, which are declared independent of any class. For the sake of simplicity there would be no metaclasses. Code for it would look something like:
Each object would consist behinds the scene as a cell sequence whose first element would point to its class and its subsequent elements would point to the class's elements. In turn, its class would be internally a byte sequence (so its contents are ignored by the garbage collector) organized into pairs of cells where the first cell in each pair is a method key (where 0 indicates that that entry is empty) and the second cell in each pair points to the code implemeting said method.
For compilation into flash, how it would work is that each implemented method would be placed (except for the method code itself) in a linked list in RAM (which is possible due to the freedom provided by zeptoscript w.r.t. memory management; I could not have easily done this with zeptoforth, hence the design of zeptoforth's OO layer), and would only be written out to flash once implementing all the methods is complete.
Also, each method would be given a global ID, which would be a positive integer for methods specified in flash and a negative integer for methods specified in RAM. The method table for each class would be a hash table with integral keys using these ID's which would contain a power-of-two entries (this is important because it avoids the need for a modulus when looking up methods).
Code: Select all
\ Declare our methods
method foo ( self -- )
method bar ( qux quux self -- )
method baz ( self -- qux quux )
\ Declare class foobar
begin-class foobar
\ Declare our members
member: foobar-qux
member: foobar-quux
\ Declare our constructor
:method new { qux quux self -- }
qux self foobar-qux!
quux self foobar-quux!
;
\ Declare our other methods
:method foo { self -- }
." FOO "
;
:method bar { qux quux self -- }
." BAR "
qux self foobar-qux!
quux self foobar-quux!
;
:method baz { self -- qux quux }
." BAZ "
self foobar-qux@
self foobar-quux@
;
end-class
For compilation into flash, how it would work is that each implemented method would be placed (except for the method code itself) in a linked list in RAM (which is possible due to the freedom provided by zeptoscript w.r.t. memory management; I could not have easily done this with zeptoforth, hence the design of zeptoforth's OO layer), and would only be written out to flash once implementing all the methods is complete.
Also, each method would be given a global ID, which would be a positive integer for methods specified in flash and a negative integer for methods specified in RAM. The method table for each class would be a hash table with integral keys using these ID's which would contain a power-of-two entries (this is important because it avoids the need for a modulus when looking up methods).
Last edited by Travis B. on Wed Apr 10, 2024 1:46 pm, edited 1 time in total.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
For some reason, I cannot get into irc.sorcery.net. It keeps saying "Unknown host. Maybe you misspelled it?" even though it's the same host I've always used.
Mureta ikan topaasenni.
Koomát terratomít juneeratu!
Anti-TESCREAL Action | He/him
Koomát terratomít juneeratu!
Anti-TESCREAL Action | He/him
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
Maybe the site is down?
I can no longer come up with decent signatures.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
Okay, OO in zeptoscript is working and is nice to use; I have always been a fan of the idea of disconnecting methods from any kind of class hierarchy -- zeptoscript OO has no inheritance, BTW -- and I have accomplished that with zeptoscript OO. I had wanted to do this with zeptoforth OO, but the limitations of the zeptoforth memory management model rendered this practically impossible, hence why I opted for a single-inheritance, methods-belonging-to-classes model for it. (However, zeptoscript class members, not methods, are specifically tied to their classes, and raise exceptions if you try to use them on any other classes.)
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
I tried pinging irc.sorcery.net today and had no problem.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
Some zeptoscript updates:
- I have written a basic guide to programming in zeptoscript. Note that it assumes at least a basic level of knowledge of programming in Forth.
- I have added the capability to have "type" classes (not to be confused with Haskell type classes) to enable the creation of methods such as show, hash, and equal? (which I will mention later) that can be called on anything.
- I have added a pair of convenience words, #[ and ]# for constructing lists, e.g. #[ 1 2 4 8 16 32 64 128 256 ]# ' . iter-list outputs 1 2 4 8 16 32 64 128 256 ok.
- I have updated my show, hash, and equal? methods in zeptoscript so they can hand larger lists without exploding the stack (by testing their arguments for whether they are valid lists non-recursively, and if they are iterating over them rather than recursively descending into them, e.g. #[ 1 2 4 8 16 32 64 128 256 ]# show type outputs #[ 1 2 4 8 16 32 64 128 256 ]# ok.
- I have added code for compiling non-string literal constant byte strings, e.g. begin-const-bytes foo $80 c, $81 c, $82 c, $83 c, end-const-bytes foo ' . iter outputs 128 129 130 131 ok.
- I have added "collect" words for generating cell sequences, byte sequences, and lists, e.g. 0 16 [: dup 1+ swap ;] collectl-cells ' . iter outputs 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ok.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
Cool stuff, travis. How does doing all this in a Forth-style environment differ from, say, a more tradtional C-style one, besides the obvious? Is it easier or harder? Etc.
I can no longer come up with decent signatures.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
It is easier, because I have much closer control over the whole execution and compiling environments, and I can effectively replace the underlying Forth environment, yet at the same time I can readily interface with the underlying Forth environment as I see fit (i.e. "foreign" words). Were I to do this in a traditional C-style environment, I would have to write a new compiler and runtime from scratch, and interfacing with C code from within the inner environment would be much more difficult.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
I have implemented continuations (think call/cc in Scheme, or in this case, in zeptoscript) and have implemented cooperative multitasking and inter-task channels with them. (Note that zeptoforth, which zeptoscript is on top of, has preemptive multitasking but zeptoscript itself cannot run on multiple zeptoforth tasks for reasons.)
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
I don't really know enough about programming to follow this, but - wasn't the original point of zeptoforth to go back to the basics with a bare metal rather than higher level language?
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
I will admit to having the same query. To me, the attraction of Forths generally is their low-level–ness — I don’t see the point of a ‘scripting Forth’, and once it’s dynamically-typed I’m not sure I’d really consider it a Forth at all.
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices
(Why does phpBB not let me add >5 links here?)
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices
(Why does phpBB not let me add >5 links here?)
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
The point of zeptoforth was to have a compiler and operating system on top of bare metal. The point of zeptoscript is to have something like Scheme implemented on top of that operating system.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Re: The Computer And General Tech Thread - Software, Hardware, Questions, etc.
I fixed the major bug I had encountered in zeptoscript, which really had nothing to do with call/cc or multitasker and everything to do with the garbage collector running when execution tokens are created, which had a bug where the top of the stack would be duplicated. Now the multitasker works beautifully now that this bug has been fixed.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.