<neto_>
"Winter is coming and Collapse OS aims to soften the blow. It is a Forth (why Forth?) operating system and a collection of tools and documentation with a single purpose: preserve the ability to program microcontrollers through civilizational collapse."
<mark4>
oh i cant view that right now my web browser wont launch lol
<mark4>
i think i have a gtk problem
<neto_>
this dude has his priorities straight
<mark4>
what does that os run on?
<neto_>
what WON'T it run on!
<neto_>
Self assembles on tight ressources. Known to self assemble on:
<neto_>
A Sega Master System with a keyboard adapter, a SD card adapter and dual EEPROM socket.
<neto_>
A TRS-80 Model 4P with floppies.
<neto_>
A RC2014 with a SD card adapter.
<mark4>
no raspberry pi? :)
<mark4>
or c64 meh
<neto_>
"Can assemble Z80, AVR, 8086 and 6809 binaries."
<mark4>
i wrote an avr assembler in forth
<neto_>
is it a risc?
<neto_>
how many lines was your assembler?
f-a has joined #forth
<mark4>
erm if i can find it ill look lol
<neto_>
just give me a ball park answer, i'm setting up a joke
<mark4>
1146 lines
<mark4>
locate to the rescue lol
<neto_>
that's BLOATED
<neto_>
I wrote an assembler in one line:
<neto_>
: subleq, ( A B C --) .$ | swap rot | 3 0 DO dq LOOP | cr ;
<neto_>
it IS for a one instruction machine, so there is that
<mark4>
mine works with every single avr chip there is as long as you create a personality for it :)
<mark4>
i only ever made one for the 32u4 tho
<neto_>
ah that's where you went wrong my friend, no subleq chips exist, so I only have to deal with my virtual machine, no nasty reality to get in the way
<neto_>
if I learnt anything from Chuck Moore is to design the software and hardware together to simplify the system
<neto_>
I found reality too bloated to I went for a virtual machine B-)
<siraben>
yeah played around with it for a bit but didn't use it
<siraben>
the person behind CollapseOS thinks we are headed towards civilizational collapse by 2030
<neto_>
ran it in linux?
<siraben>
yeah and macOS
<neto_>
this has TempleOS vibes
<neto_>
I like that
<neto_>
Tery created a great programming enviroment with TempleOS
<neto_>
ie: images were embedded directly in files
<neto_>
the shell was a JIT compiler of his version of C
<neto_>
obv it was all written in HolyC, his version of C
<neto_>
640x480 was the only supported format
<neto_>
256 colors I believe?
<neto_>
just really great stuff
<neto_>
I should look more into CollapseOS and the guy behind it
<f-a>
he is a sad story
<f-a>
but very talented
<neto_>
I think his end was tragic, but I'm happy he spent his last years working on what he believed in
<neto_>
an inspiration to us all, showing us what we can achieve when we go against the current on our own
<neto_>
a few fans have kept developing TempleOS
<neto_>
I know some even added TCP/IP support
<f-a>
well he obviously had some mental illness
<f-a>
apparently — but don’t quote me on that — schizophrenia
<f-a>
really a crippling illnes
<neto_>
he most certainly did, not that that's a bad thing
<f-a>
having schizophrenia?
<neto_>
yes
<f-a>
well it was not is fault but it is a bad thing, I feel, no?
<neto_>
he seemed freer than a normal person will ever be
<neto_>
and he spent his last years working on the his love project
<neto_>
and had many genuine fans by the end
<neto_>
I don't agree with many of his views, but I appreciate his intellectual freedom that you won't find in any "normal" person
joe9 has quit [Quit: joe9]
joe9 has joined #forth
neto_ has quit [Quit: Lost terminal]
dave0 has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
dave0 has quit [Quit: dave's not here]
<tabemann>
the thing about CollapseOS is that it assumes we'll all be using Z80's after the collapse
<siraben>
sounds like a nightmare scenario if something causes all the chip fabs to become useless
<f-a>
I suspect knowing some basic calculus and/or a slide rule will be more useful than anything like that
<tabemann>
yeah
<f-a>
but hey it is a hobby project and you can learn a lot from it
* tabemann
's hobby project is a forth based OS for the cortex-m, and he's learned a lot from it
<tabemann>
well, cortex-m4 or cortex-m7
<f-a>
I have read somewhere
<f-a>
that the state/universe preppers prepare for
<f-a>
is suspiciously similar to the one they lived in their childhool
<f-a>
at least technology wise
<f-a>
which made me smile
<tabemann>
interesting
<f-a>
well if you think about it, it is ture
<f-a>
*tue
<f-a>
gah
<f-a>
true!
<siraben>
Freud moment? (something something longing for childhood)
<f-a>
we kind of reenact our childhood fantasies, sometimes with more expensive toys
<f-a>
yeah siraben , exactly
<siraben>
but presumably the world one lives in their childhood is advancing technologically all the time
* tabemann
's childhood fantasy was to write his own OS, and now thanks to cortex-m he has
<f-a>
I believe learning forth
<f-a>
and using it
<f-a>
taught me a lot about machines
<f-a>
I had not idea was an adress(sp) was, a byte etc
<f-a>
so: omnia in bonum
<mark4>
siraben: i cant watch that yet, my gtk is broken or somethng, ill see if a reboot fixes it. firefox wont launch
mark4 has quit [Quit: Leaving]
<tabemann>
forth to me is the only non-trivial computing environment that one can program all by oneself and can fully understand without being a superhuman
<siraben>
mark4: you could just clone it :)
<f-a>
↑ (@ tabemann )
<f-a>
it is so refreshing
<f-a>
coming from Haskell
<siraben>
for me the same can be said about functional programming
<f-a>
when basically you treat the compiler as some kind of magic
* tabemann
tried implementing scheme at one point at it was just too complicated
<siraben>
ok yeah FP compilation is another set of voodoo altogether, heh
<siraben>
but interpretation of functional languages is relatively simple.
* tabemann
came from Haskell too
<f-a>
I know, I recognise the nicks from a certain channel :P
<siraben>
tabemann: which part did you struggle with? and what was the implementation language?
<siraben>
I think continuations and hygienic macros are the hardest (for me at least0
<tabemann>
siraben: the implementation language was Haskell, and the hard part was macros and shit
<tabemann>
whereas doing macro-y things in forth is trivial
<f-a>
that is syntax-rules, right?
<siraben>
well unhygienic macros is straightforward but syntax-rules yeah tougher
<siraben>
core scheme being if, set, lambda, const, id
<siraben>
Looks like dynlib error to me
<f-a>
siraben: thanks, I suspected so
<siraben>
tabemann: +1 [if] [then]
<f-a>
wonder if one could put scheme into GATDs
<siraben>
Yeah for type safety?
<f-a>
yeah
<tabemann>
siraben: what I did is write a word that tests whether a word is defined or not, and then uses that to either raise an exception (if a word needed isn't defined), or to not compile code (if something has already been compiled)
<siraben>
Btw, when I was refactoring the denotational semantics into a monad transformer stack I came up with
<siraben>
newtype Scheme m u r s a = Scheme {unScheme :: ReaderT u (StateT s (ContT r m)) a}
<siraben>
It's a self-hosting compiler for a subset of Haskell that has been bootstrapped from a 357 bytes seed
<f-a>
super interesting
<siraben>
not directly doing anything for the GCC bootstrap yet but it may in the future/serve as a bootstrap for GHC
<siraben>
yeah this is the same project that takes that seed and plans to go to GCC via Guile
<tabemann>
interesting
<siraben>
They have a Forth implementation to but apparently it was a dead end, maybe a true Forther can prove them wrong!
<siraben>
I wonder how hard it would be to write a C compiler in Forth.
<f-a>
you would have hundreds of blogpost on how pointless the endeavour is
<siraben>
would be all talk no action
<siraben>
I've only done up to a LL(1) parser generator in Forth, so I guess that's something.
routeveg has quit [Quit: leaving]
mark4 has joined #forth
<mark4>
seems that kde plasma with +gtk support has an assinine dependency on wayland
<mark4>
recompiling kde-meta with a -gtk use flag fixed everything
<tabemann>
back
proteus-guy has quit [Ping timeout: 245 seconds]
<f-a>
would that be enough for C siraben ?
* f-a
has no idea
<f-a>
is parsec ll(1)?
<siraben>
f-a: probably. C was designed to be compilable in one pass.
<siraben>
Parsec is LL(∞) if you use try, LL(k) otherwise, because parsers can consume unbounded lookahead with try
<f-a>
everyone uses try!
<siraben>
Let me double check by looking at the parsec paper
<f-a>
well everyone uses megaparsec nowadays
<siraben>
heh "LL(∞) is a powerful grammar class. Any non-ambiguous context-free grammar can be transformed into an LL(∞) grammar. In practice, there are many languages that require arbitrary lookahead; for example, type signatures in Haskell or declarations in C."
scoofy_ has quit [Read error: Connection reset by peer]
<mark4>
siraben: that link you posted is much more professionally presented than x4/x64/t4 :)
<mark4>
like err.. you have docs and everything lol
<siraben>
heh, I was a high schooler with too much free time after uni applications
<mark4>
lol
<mark4>
i have a dental appointment tomorrow and i am supposed to have paperwork filled in electronically before then. ;/
<mark4>
i hates paperwork ive been procrastinating lol
* mark4
gets a JD :p
<remexre>
siraben: any chance you've tried LR? been meaning to do that, I always suspected it'd be a good fit (use the data stack as the parse stack, etc)
<siraben>
remexre: haven't looked into LR/LALR yet
<remexre>
my hot take is, LR is totally worth learning, and not /that/ hard; LALR is a gross hack on top of it that gives the whole family of parsers a bad reputation
<remexre>
but the forth side would be the same for both, the hack is in the generator
dave0 has joined #forth
<siraben>
remexre: what advantage does LR have over LL(k)?
<remexre>
can do left recursion; generally, warns you about problems ahead of time
<remexre>
there exist some composition properties, but idk how generalizable they are
<remexre>
(like, if you have two parse tables, there exist some guarantees about being able to parse "language A, but with every valid parse of language B as an Expr in A"
<siraben>
I see.
really2 has quit [Ping timeout: 260 seconds]
andrei-n has joined #forth
klys_ has quit [Quit: Reconnecting]
klys has joined #forth
jedb_ has joined #forth
jedb has quit [Ping timeout: 260 seconds]
mark4 has quit [Remote host closed the connection]
mirrorbird has joined #forth
<proteus-guy>
siraben, there's a fairly famous project that generates C code from forth. It's very forth-like yet incredibly readable. Naturally forth is also great for making any kind of compiler and could certainly make a C compiler should you want such a thing. :-)
proteusguy has quit [Ping timeout: 272 seconds]
<siraben>
proteus-guy: Which project is this?
<proteus-guy>
siraben, I haven't seen it in years.... I'd have to scour the interwebs for it again.... back ground is that he was a forth dev but his employer insisted on the project being done in C. So he wrote a forth program to write the C code. haha
<proteus-guy>
he is also into literate coding styles.
<siraben>
Interesting. Well a C compiler written in Forth would certainly be useful for bootstrapping since implementing Forth in assembly is straightforward compared to implementing a C compiler in assembler
<proteus-guy>
there was also some other technical innovation he did that is what initially attracted me to his work but I've forgotten what it is.... now I have to go find it again...
<siraben>
I like this line in the README, heh: "Additionally, all code must be able to be understood by 70% of the population of programmers. If the code can not be understood by that volume, it needs to be altered until it satisfies the above requirement."
andrei-n has quit [Read error: Connection reset by peer]
hosewiejacke has joined #forth
andrei-n has joined #forth
m2rrorbird has joined #forth
mirrorb2rd has joined #forth
mirrorbird has quit [Ping timeout: 265 seconds]
mirrorbird has joined #forth
m2rrorbird has quit [Ping timeout: 264 seconds]
mirrorb2rd has quit [Ping timeout: 246 seconds]
andrei-n has quit [Read error: Connection reset by peer]
neto has joined #forth
Guest74078 is now known as KipIngram
andrei-n has joined #forth
hosewiejacke has quit [Ping timeout: 245 seconds]
tech_exorcist has joined #forth
f-a has quit [Ping timeout: 265 seconds]
andrei-n has quit [Read error: Connection reset by peer]
hosewiejacke has joined #forth
hosewiejacke has quit [Ping timeout: 245 seconds]
hosewiejacke has joined #forth
mirrorbird has quit [Ping timeout: 256 seconds]
hosewiejacke has quit [Ping timeout: 276 seconds]
mirrorbird has joined #forth
elioat has joined #forth
dave0 has quit [Quit: dave's not here]
mirrorbird has quit [Remote host closed the connection]
mirrorbird has joined #forth
mark4 has joined #forth
<mark4>
had a dental appointment today for a full checkup and to schedule work... did the checkup when to pay and arrange for next appointment for the first of 4 cleanings and for one extration (aww).
<mark4>
well. they threw a curve ball at me... they have time slots TODAY for both lol
<mark4>
so. woke up today expecting a checkup and will be having an extraction :/
<mirrorbird>
nice
andrei-n has joined #forth
f-a has joined #forth
f-a is now known as laPlastaAngloPar
hosewiejacke has joined #forth
laPlastaAngloPar is now known as f-a
hosewiejacke has quit [Ping timeout: 272 seconds]
elioat has quit [Quit: elioat]
<mark4>
yea. had my second appointment and had my first cleaning. my bottom front teeth are not straing and one of them looks recessed compard to the others and i could never clean it right
<mark4>
being a coffee drinker that tooth has been really badly stained for decades
<mark4>
it freeking looks white now!
<mark4>
my extraction is also later day. not looking forward to that lol
hosewiejacke has joined #forth
<mark4>
want coffee lol but i probably wont taste it and dont want to burn myself lol
mark4 has quit [Remote host closed the connection]
hosewiejacke has quit [Quit: Leaving]
neto has joined #forth
gravicappa has quit [Ping timeout: 245 seconds]
f-a has quit [Ping timeout: 256 seconds]
mark4 has joined #forth
<mark4>
took 15 minutes to do
<mark4>
didnt feel a thing!
<mark4>
yet lol
<veltas>
Did you hear anything though
f-a has joined #forth
<f-a>
I have lots of words like
<f-a>
: create-output-file ( addr-s us -- wfileid ) w/o bin create-file throw ;
<mark4>
no actually
<f-a>
which I only use once
<mark4>
i had headphones on and i dont think i needed them
<mark4>
i did not hear any crunching or anything
<veltas>
I would have asked for headphones, ugh would not enjoy that. I have a thing about teeth
<f-a>
should I keep it that way or put w/o bin create-file throw in the body of the callee?
<veltas>
f-a: It's up to you
<mark4>
i had my own on, listening to music :)
<veltas>
I would keep it factored like that, because I hate the noise
<mark4>
i go back again for another cleaning session,
<veltas>
Also I would use abort"
<mark4>
yea im not a fan of throw in forth, i use abort and abort"
<mark4>
i dont even know how to implement throw :)
<f-a>
I lifted it from gforth manual
<veltas>
It's not that hard but I have never had the urge
<veltas>
The urge to use yet alone implement
<veltas>
I find exceptions are the least thought-out part of any programming language, except Java really
<mark4>
people badmouth java but what they should really be badmouthing is java coders who dont know what they are doing lol
<veltas>
I don't like the way you pass parameters to a word that might throw, and then you need to drop the parameters again even if they're consumed
<mark4>
java is a good language and for being oopificated it has a very small footprint
<veltas>
Java is a bit dated and convoluted now but there were a lot of solid ideas early on
<mark4>
and can be embedded
<veltas>
And it's a stack machine!
<mark4>
well so is C ;)
<boru>
I'd argue that the C abstract machine has a bit of a bias toward register machines given keywords like `register`, though I suppose the implementation is free to ignore them.
<boru>
I would agree that Sun had some clever guys working on Java in the early days, however.
<mark4>
c traditionally does not pass parameters in register but on the stack due to the register starved nature of some processors :)
<boru>
Hmm, I can't remember if Peter van der Linden worked on the JVM spec or language spec.
<boru>
Stacks don't exist so far as the C abstract machine is concerned, I think. That's moreso an implementation detail, and usually defined by a calling convention, at that.
<boru>
Being pedantic by way of the standard, that is.
<boru>
I think that the closest you get to 'stack' is automatic storage.
<veltas>
K&R C necessitates passing on the stack, because there are no prototypes, and any function can be variadic by just passing more parameters
<boru>
I don't have the K&R spec to hand to see that, just ANSI/ISO.
<veltas>
Google K&R 1st ed pdf, I think there's a scan on archive.org
<veltas>
I use that when I want to double-check stuff, but prototypes are a pretty big difference I just know by heart, as are the variadic functions
<veltas>
In K&R 1st ed they don't mention headers, and they only forward-declare functions (without declaring the number or nature of parameters) when the return type is not int
<boru>
Well, the variadic functions bit also applies to ISO C, in the sense that `f()` implies unspecified arguments, whereas `f(void)` is no arguments.
<veltas>
Yes because prototypes are (were?) optional
<veltas>
K&R C feels much closer to Forth than ANSI C
<boru>
I would say that's reasonable.
elioat has quit [Quit: elioat]
<boru>
I was just scanning through UPE to see if there were any allusions to that requirement there, but it just defers to K&R 1ed.
<veltas>
I seem to remember even the older x86 ABIs all used stack parameter passing
<veltas>
And there was a "fast call" ABI you could choose per-function or as a special option that used registers
Vedran has joined #forth
<boru>
Yeah, their stdcall cc was stack-centric for arguments.
<boru>
That's the case for many calling conventions. Non-stacked arguments showed up on ISAs with lots of registers, first.
<boru>
Fortunately, C wasn't developed with intel in mind.
<neuro_sys>
All these time never checked K&R 1ed, good reminder.
andrei-n has quit [Quit: Leaving]
<neuro_sys>
Every now and then I see pre ANSI C code which looks funny
<neuro_sys>
I'm wondering if I can use Forth as a template pre-processor, as in, generate code for another language.
<neuro_sys>
I obviously can, but in some other way than using s" " all over the place. Probably not very fruitful though.
<neuro_sys>
One use case is that I felt like using it for generating Z80 code for an assembler.
<veltas>
Maybe if you have a special sequence that switches into the language it's templating and back
<veltas>
Like retro with ~~~ or whatever it is
<veltas>
So when you encounter ~~~ it just starts adding every line to the output without changing, and then when it reaches another ~~~ it gets back to running forth code
neto has quit [Ping timeout: 260 seconds]
<veltas>
Something like : ~~~ BEGIN REFILL SOURCE S" ~~~" COMPARE WHILE SOURCE TYPE REPEAT ;
<neuro_sys>
That's good point
<veltas>
Might need SOURCE TYPE CR actually
<veltas>
I haven't tested that if it's not clear :P
<veltas>
All my good points are stolen from crc and other people really
<neuro_sys>
Using the input stream and the eval loop of Forth is something I forget the existence of
<neuro_sys>
And hence I didn't know the words SOURCE and REFILL
bluekelp_ has joined #forth
bluekelp has quit [Ping timeout: 260 seconds]
<boru>
I've got a listing for a Pascal compiler written in figForth if you're interested in it.
bluekelp_ has quit [Ping timeout: 245 seconds]
<veltas>
*I'm* interested in that
<boru>
It's a PDF scan. I uploaded it for MrMobius the other day. It might still be hosted. One moment.
bluekelp has joined #forth
<boru>
I've got the listing for figForth for the 6809 as well, if you want it.
<veltas>
That's on forth.org right?
<veltas>
Or did you make that yourself?
<neuro_sys>
I would be interested in too
<boru>
It was a scan from the actual hard listing someone had.