<KipIngram>
So it looks like it would be fairly easy to implement a bytecode interpreter for this little setup.
tech_exorcist has quit [Quit: tech_exorcist]
APic has joined #forth
APic has quit [Ping timeout: 265 seconds]
<KipIngram>
nihilazo: How did you happen upon this website? It's a fairly esoteric collection of little toys.
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
APic has joined #forth
APic has quit [Ping timeout: 240 seconds]
crc has quit [Ping timeout: 250 seconds]
APic has joined #forth
crc has joined #forth
nitrix has quit [Quit: Genius is one percent inspiration and ninety-nine percent perspiration]
nitrix has joined #forth
<proteusguy>
KipIngram, your assembler generates x86_64 asm code or actually generates binary machine op codes?
<KipIngram>
Oh, it generates machine code.
<KipIngram>
Just to be clear, it's in no way the complete instruction set.
<KipIngram>
Not even close.
<KipIngram>
But it's a decently broad swath of useful instructions.
<KipIngram>
The screen shot I posted earlier leaves out a small bit. It was just easy to get those two screens up together in my editor, and the "heart of it" is in there.
<KipIngram>
That view is of a two-block screen oriented editor in action.
<KipIngram>
I can use vim keystrokes to move around in those buffers and edit the content.
<proteusguy>
KipIngram, that's an impressive project that can generate binary code for x86_64. Very cool. Are you publishing it?
<KipIngram>
Not yet; that's the first I've shared it.
<KipIngram>
And thank you. I just started at some of the big, important (and long-historied) instructions until I could see a pattern come out.
<KipIngram>
I think the instruction set must have been more sensibly organized in the beginning, so the old instructions organize up better than the newer ones.
dave0 has joined #forth
<dave0>
maw
<KipIngram>
Hey hey.
<KipIngram>
Is it done yet? ;-)
<dave0>
is anything every really done? ;-)
* dave0
all philosophical
<dave0>
but to answer your question... no it's not :-p
<dave0>
i'm cleaning up some code and wrestling with gcc
<dave0>
i want my code to run on a DOS.COM file
<dave0>
eventually it will become a boot loader
<dave0>
because forth seems perfect for a boot loader
<dave0>
tiny code, and if there's a boot failure, i can drop into the REPL so the computer is still useable
<KipIngram>
I was joking - it's a bit of work you're looking at.
<dave0>
lol okay :-)
<dave0>
i'm trying to get gcc to produce a dos file to run under dosbox
<KipIngram>
That's not something it does?
<dave0>
i did it with command line switches and it's a bit of a hack
<dave0>
i'm going through the documentation on the gnu linker to make a script for it
<dave0>
(i'm running on NetBSD)
mark4 has quit [Ping timeout: 246 seconds]
<shmorgle>
ficl is used as a boot loader for I think one of the OpenSolaris based installers
<KipIngram>
I really like the idea of a Forth bootloader.
<KipIngram>
I've contemplated trying to make mine a reasonable shell.
<proteus-guy>
dave0, yep... it's a minimalistic forth.
proteus-guy has quit [Quit: Leaving]
proteus-guy has joined #forth
proteus-person has joined #forth
proteus-person has quit [Remote host closed the connection]
Zarutian_HTC has quit [Remote host closed the connection]
cantstanya has quit [Ping timeout: 240 seconds]
cantstanya has joined #forth
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #forth
gravicappa has joined #forth
dave0 has quit [Quit: dave's not here]
dave0 has joined #forth
<dave0>
maw
f-a has joined #forth
f-a has quit [Ping timeout: 240 seconds]
f-a has joined #forth
f-a has quit [Ping timeout: 240 seconds]
f-a has joined #forth
<veltas>
My Z80 Forth has one instruction it can generate, which is CALL, because it's a direct threaded forth so I use CALL when adding words to the dictionary
<veltas>
And then will I ever add more.... stranger things have happened
<veltas>
proteus-guy: sectorforth is awesome
<veltas>
The numbers remind me of how I did numbers in my forth before I wrote >NUMBER
<veltas>
But there is a wow factor with fitting it in 512 bytes and quickly I'd rather just have a larger forth that can do stuff without painful intermediate work :P
<veltas>
There's definitely educational value in things like that too
<KipIngram>
proteus-guy: That's VERY nice, sir. I've always wondered what could be accomplished at the extreme simple end; there it is. Excellent!
<KipIngram>
I should try to do one someday, but so far I've just always wanted a high-performing system.
<KipIngram>
A nannd primitive - I'm enough of a hardware guy to know that was the logical approach - it's what I'd have tried to.
<KipIngram>
Thanks so much for sharing.
<KipIngram>
I intend to share this one I'm working on too - I haven't actually shared one with the world yet, but I think this is the one I'll be proud enough of to do so with. :-)
<KipIngram>
It's "basis" is clean - I'm very pleased with the macros that construct the dictionary and so on.
<KipIngram>
I'm including the entire "orthogonal set" of conditional returns and looping words - but over this past weekend I produced a Python tool for generating the source of those automatically, using "virtual instructions." So I'm hardly going to count those as required port items, since once a working set of irtual instruction macros have been created you get them more or less with no porting work.
<KipIngram>
I really need to experiment with qemu, or a similar tool.
<KipIngram>
I like the 4k input buffer.
<KipIngram>
What can I say? I like the whole approach. Well done.
<KipIngram>
So you've reserved one bit in the count byte of names for future use? Looks like you're not doing anything with 0x20 yet.
<KipIngram>
Oh, yes - you say so.
<KipIngram>
My target for this effort is a nasm file that will assemble and run on MacOS and which is capable of LOADing 4k source blocks from a BLOCKS.DAT simulated disk file, and then a BLOCKS.DAT file which provides a reasonable set of development tools, including a source editor.
<KipIngram>
The second target will then be to provide a BLOCKS.dat file which is capable of recompiling the system, along with full source for doing just that.
<KipIngram>
So if I include a MacOS binary in that second target, one should be able to start using and changing the system immediately without having to actually use nasm.
<KipIngram>
The idea is for that to be a near-optimum performing system, so obviously it lands in a different design point that sectorforth.
<KipIngram>
When that second target is achieved, though, you should be able to use the system to cross-compile for other targets.
jess has quit [Quit: Changing server]
<KipIngram>
I expect the first target to do a full handling of normal Forth interpretation errors, with a restoration of the system to its "Enter key" state when a typed line produces an error.
jess has joined #forth
<KipIngram>
The first target will have slightly less than optimal NEXT and (:), (var), and (constant), because of requirements imposed by the Mac-OS MACH-O execution format. But the second target should rebuild a system that has optimal versions of those things (absolute addresses in the image).
<KipIngram>
Instead of offsets that the code handlers have to produce absolute addresses from.
<KipIngram>
The first target will offer my own crafted set of control structures in the nasm/binary source, and will offer standard control structures via BLOCKS.DAT source (I'll probably arrange it so that 1 LOAD loads the "completion" source from BLOCKS.DAT).
<KipIngram>
Second target will rebuild with all standard controls structures and my own structures available.
<KipIngram>
Man, getting the whole thing into one 512b sector is very cool. :-)
<KipIngram>
Oh, interesting, proteus-guy. Your : word is written in assembly.
f-a has left #forth [#forth]
<KipIngram>
Heh - there's a Chuck quote in that website we got the link to yesterday.
<nihilazo>
is there a standard/best practice way to create a 2d array in forth?
<KipIngram>
Not that I'm aware of - the piece of the Forth mind set that seems to apply there to me is to do whatever makes the most sense for your application at hand.
<KipIngram>
What's going to be in your array?
<KipIngram>
Do the rows or columns have significance of their own?
<KipIngram>
Or is it truly 2D data, like the pixels of a photograph?
<KipIngram>
If the rows or columns do have significance, then store it and access it by rows, or columns. I.e., have a "vector of vectors." If it's really 2D data, then you'll probably be interested in "neighborhoods" within the data, like to apply Laplacians in image processing etc. - in that case the stride dimension needs to be part of what's stored, so that you can find the neighbors of any item.
<nihilazo>
this is for a map in a game
<nihilazo>
so it is truly 2d data I suppose
<nihilazo>
but not that needs to have much fancy stuff done to it
<KipIngram>
Yes, I think so. Ok, well, then you need to store it in a way that lets you identify neighborhoods. Whether you store by rows or columns is probably not too significant.
<nihilazo>
stride dimension?
<KipIngram>
If a matrix is stored by rows, first row 1, then row 2, etc. - thenn the row length is the stride.
<KipIngram>
If it's stored by columns, then the column length is the stride.
<KipIngram>
How far do you have to step in memory, to reach the same item of the next row/column? That's the stride.
<nihilazo>
ah ok
<KipIngram>
It's not some big official term or anything, but I've seen it used.
<nihilazo>
this doesn't really have to be performant either tbh
<nihilazo>
any way would likely work
<KipIngram>
Right. Well, FORTRAN stored arrays by columns. Most other languages have you think of it as a vector of vectors - the innner vectors can be rows or columns; it's really up to you.
<KipIngram>
One thing you should decide is whether you want to think of accessing it as map(x,y), or map(x)(y). See the difference?
<KipIngram>
In the first case you're considering a 2D thing - in the second you're considering a 1d array of 1d arrays.
<nihilazo>
ah ok
<KipIngram>
In Forth you invent your "way of thinking," and then code it.
<KipIngram>
A popular slogan/phrase in a lot of the Forth books is that you "develop a language for talking about your application."
<KipIngram>
And the Forth words are words in that language.
<KipIngram>
And the more intuitive that language can be to a user, the better.
<nihilazo>
yyeah
<KipIngram>
So hey, how did you run across that xxiivv.com website? That's kind of an interesting place.
<KipIngram>
Weird mix of tech, philosophy, etc.
<KipIngram>
Guy seems to have drunk the open source / techno anarchist kool aid in a pretty major way. :-)
<nihilazo>
it's a fun site, I've actually been messing with uxn recently which is made by the same person
f-a has joined #forth
<nihilazo>
they hang out on freenode some places
<nihilazo>
and mastodon
<KipIngram>
Yeah, that uxn bytecode is kind of interesting.
<KipIngram>
I haven't decided just how "good" I think it is, but it's interesting.
<KipIngram>
The flexible way it deals with either bytes or words - that's a twist I haven't really seen before.
<KipIngram>
Usually in Forth you have a lot of words that deal with whatever your system word size is, and then you have some side words that let you do stuff with bytes, etc.
<KipIngram>
But uxn has the dual support rooted very deeply in the encoding of the bytecode.
<nihilazo>
yeah, it's interesting
<KipIngram>
And the dual use of data and return stack - that's equally "bilateral" and encoded.
<nihilazo>
I found it from orca originally
<nihilazo>
which is another one of the same person's projects
<nihilazo>
an unusual music sequencer/livecoding environment
<KipIngram>
Well, the whole site has an interesting "exotic flair" to it.
<KipIngram>
"Unusual stuff."
<veltas>
It feels like a lot of effort went into aesthetic, but that's not really a turn-off. I am encouraged by how short the programs are
<nihilazo>
yeah, I really enjoy the xxiivv aesthetic and software development philosophy
<nihilazo>
I was a member of https://merveilles.town for a bit (the same guy's mastodon instance) but it felt a bit culty
<nihilazo>
they had a policy of setting any personal posts to unlisted which I was very not comfortable with
<nihilazo>
but yeah, xxiivv is cool. There's just a slightly culty culture around it imo
<veltas>
All these software cults feel like cults
<nihilazo>
merveilles very much had the vibe of being a bit of a cult, I ended up moving back to my old mastodon instance and just following people there rather than being part of it
<veltas>
There are a lot of groups online that have good ideas, and where their communities are dominated by weird or toxic people
<nihilazo>
Devine is a really chill person tho, I think the vibe of merveilles being a bit weird was by accident
<veltas>
The issue is communities get dominated by people who have a lot of time on their hands, and usually those are not the 'best' of us....
<veltas>
That is my opinion
<KipIngram>
That is a very reasonable hypothesis.
<KipIngram>
The highest quality people are usually busy.
<KipIngram>
Busy pursuing something other than "celebrity status."
APic has quit [Ping timeout: 240 seconds]
<nihilazo>
idk how people like Devine manage tbh? like, either they don't talk about work at all
<nihilazo>
or they can somehow spend all their time doing random personal projects like uxn
<nihilazo>
I've no idea how somebody has an income source while living on a boat sailing around the world making open source
<veltas>
Some people just have money
APic has joined #forth
<veltas>
And also as I've gotten older I've found it easier and more rewarding to work rather than talk about what I'm doing
<nihilazo>
tbh idk how you live on a boat. like, it seems fun but I don't think I could live with having such a small space
<nihilazo>
everybody's different ig
<veltas>
I think we should all know how to live in isolation after 2020
<veltas>
It's something I would do if I was a bit more disconnected, but as it is I'm engaged and actually have some social ties
<nihilazo>
idk how I want to live tho, tbh
<nihilazo>
however I end up living I don't want to be alone or with people I dislike, I learned that from 202
<nihilazo>
however I end up living I don't want to be alone or with people I dislike, I learned that from 2020
<KipIngram>
Engaged is good, veltas. Family is good. My wife and daughters are the backbone of my life.
<KipIngram>
Congratulations. :-)
<veltas>
Thanks
<KipIngram>
One of my daughters just got married in December.
<veltas>
Nice
<KipIngram>
Two married - there not yet. Well, two not yet - one just 16.
<KipIngram>
So I shouldn't count her yet.
<f-a>
good luck to the newlywed
<KipIngram>
Thank you - they seem to be off to a good start.
<f-a>
finished «The Metamorphoses» by Apuleius, what a book!
<KipIngram>
Did you read it in Latin?
<KipIngram>
Or a translation?
<f-a>
parallel text LAT/ITA, tho my latin would be insufficient to read it w/o a translation
dave0 has quit [Quit: dave's not here]
<KipIngram>
Nice.
<KipIngram>
Sometimes I think the days when we were all challenged to learn Latin (if we wanted to call ourselves well educated) were better.
<KipIngram>
Maybe not.
<KipIngram>
I just hope we haven't given something up.
<KipIngram>
If you "have Latin" at all you're ahead of me.
<KipIngram>
I've told myself a couple of times I'd self-study it.
<KipIngram>
Found some websites.
<MrMobius>
veltas, i think for an assembler, easier to implement is what you want to avoid
<KipIngram>
Yeah... uh, no - that went nowhere.
<KipIngram>
I'd think you'd want your assembler to be easy to *use*.
<MrMobius>
at least if its something youre actually going to use to write assembly with. if its just a toy project then easy to implement is fine
<KipIngram>
My other thought on that would be that you don't necessarily need a COMPLETE coverage of an instruction set for it to be (very) useful.
<KipIngram>
My x64 assembly coverage is rather meager, but I can still do a lot.
<MrMobius>
surr if you can make it easy to implement and easy to use then go for it. those 2 things dont tend to correlate for something like an assembler
<KipIngram>
I have no intention ever of trying to support the entire x64 instruction set - it's a monster.
<MrMobius>
one of my pet peeves is all the harebrained schemrs people come up with because parsing syntax is hard
<MrMobius>
ie LDA #5 vs LDA 5
<MrMobius>
some people make assemblers that only accept LDA_IMMED 5 and LDA_ZP 5
<KipIngram>
ZP?
<f-a>
latin today is less difficult
<f-a>
you can even use duolingo etc.
<f-a>
any language today is easier to be fair
<MrMobius>
so you saved yourself a small amount of work implementing the assembler and will more than make up for it in wasted time if you actually write assembly for it
<nihilazo>
I started learning latin
<nihilazo>
but duolingo for latin isn't too great, and I started reading lingua latina per se illustrata and just couldn't find the motivation to continue with it
<nihilazo>
because you have to learn so much before you get to the point you can read anything even remotely like an actual text
<MrMobius>
KipIngram, zero page on 6502
<MrMobius>
LDA 5 is a different instruction than LDA 1005 since 5 fits in one byte
<KipIngram>
I see.
<KipIngram>
Yes - I'd want the assembler to decide that for me - I wouldn't want to have to keep up with it myself.
<KipIngram>
256 < is not that hard to type...
Zarutian_HTC has joined #forth
<proteusguy>
KipIngram, yes the NAND primitive is pretty cool. And were I to make a boot sector forth it would definitely take up a few more sectors. But this offers a lot of inspiration.
<KipIngram>
I think it's way cool. :-)
f-a has quit [Quit: leaving]
f-a has joined #forth
Zarutian_HTC has quit [Ping timeout: 240 seconds]
<KipIngram>
Aha, that find code is working.
<KipIngram>
I made one mistake typing it in. I have a word called .w@ that is supposed to fetch 16 bits from an address but keeps the address too (because of the .).
<KipIngram>
When I coded it I used dword to specify the fetch size, instead of word.
<KipIngram>
Took a while to chase that down.
<KipIngram>
But now it fires up and lets me type lines at it. It parses those lines into words, and then prints out, one word per line, the words it finds, but not the words it doesn't.
<KipIngram>
And it seems to be doing that perfectly.
<KipIngram>
Checked both ends of the dictionary as well as in the middle.
<KipIngram>
The code is there to search multiple vocabularies, but I only have one right now, so part of it is untested.
<KipIngram>
Guess I could put FORTH in the list twice.
<KipIngram>
Or make a stub vocabulary - that would be better.
<KipIngram>
Or just wait.
_whitelogger has joined #forth
f-a has quit [Read error: Connection reset by peer]
f-a has joined #forth
gravicappa has quit [Ping timeout: 240 seconds]
djinni has quit [Quit: Leaving]
gravicappa has joined #forth
djinni has joined #forth
<KipIngram>
Milestone!
<KipIngram>
It executes found words now.
<KipIngram>
It's an interpreter!
<f-a>
clap
tech_exorcist has joined #forth
f-a has quit [Quit: leaving]
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
gravicappa has quit [Ping timeout: 240 seconds]
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
proteusguy has quit [Ping timeout: 260 seconds]
tech_exorcist has quit [Remote host closed the connection]
lispmacs[work] has quit [Remote host closed the connection]
tech_exorcist has joined #forth
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
proteusguy has joined #forth
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
Zarutian_HTC has joined #forth
wineroots has quit [Remote host closed the connection]
lispmacs[work] has joined #forth
dave0 has joined #forth
<dave0>
maw
<kiedtl>
wam
<dave0>
hi kiedtl
<kiedtl>
ehlo
lispmacs[work] has quit [Remote host closed the connection]
lispmacs[work] has joined #forth
<KipIngram>
So, this thing seems to be working just fine, doing as much as you could expect with no number input and "interpret only" operational. No error messages yet, though. It just ignores words it can't find and executes ones it can.
<KipIngram>
I can exercise things fairly well - for instance bl bl + 1+ should put me an "A" on the stack.
<KipIngram>
Then I can muck arounnd for a while and then emit.
<KipIngram>
I have my BLOCK word written so that if BLK is zero it returns the tib. The other case is currently stubbed out.
Zarutian_HTC1 has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC1 has quit [Ping timeout: 260 seconds]
Zarutian_HTC has joined #forth
tech_exorcist has quit [Ping timeout: 265 seconds]