f-a has quit [Read error: Connection reset by peer]
f-a has joined #forth
lispmacs has quit [Remote host closed the connection]
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
<Zarutian_HTC>
is there somewhere an nacl/libsodium pure forth implenentation that does not call out to c code?
<Zarutian_HTC>
I could hand translate the wasm version I suppose
<Zarutian_HTC>
why? well I want to run it ontop of my fcpu-32 or -16 fantasy comp (that kind of vm) which I might implement both in software emulation and through ben eather style breadboard comp
<crc>
I'm aware of two nacl projects; one is for running native code in a sandbox, the other is a crypto thing
<crc>
Given the crypto references in the linked python file, I'd assume this is the crypto one
dave0 has joined #forth
f-a has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
<lispmacs>
earlier I had said that there was no minimalist emacs clone that had a built-in lisp engine. Actually, somebody managed to get a Scheme engine in Zile:
<lispmacs>
on my system (binaries not stripped or size optimized) the executable is 359Kb. Though, there is a few MBs of link dependencies, most significantly libguile providing the Scheme engine
<lispmacs>
it might be interesting if somebody did the same project withh tinyscheme
wineroots has quit [Remote host closed the connection]
f-a has quit [Quit: leaving]
dave0 has quit [Quit: dave's not here]
hosewiejacke has joined #forth
<siraben>
lispmacs: oh great
hosewiejacke has quit [Ping timeout: 245 seconds]
dave0 has joined #forth
_whitelogger has joined #forth
really2 has joined #forth
really2 has quit [Ping timeout: 264 seconds]
tech_exorcist has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
<nihilazo>
if I'm building in forth for AVRs, is amforth or flashforth better?
KipIngram has quit [*.net *.split]
TangentDelta has quit [*.net *.split]
lonjil has quit [*.net *.split]
lonjil2 has joined #forth
TangentDelta has joined #forth
KipIngram has joined #forth
KipIngram is now known as Guest47703
Guest47703 is now known as KipIngram
wineroots has joined #forth
really2 has joined #forth
really2 has quit [Excess Flood]
clog has quit [Ping timeout: 260 seconds]
<lispmacs>
nihilazo: I have not used amforth, so I can only tell you the reasons I like flashforth:
<lispmacs>
1. automatically saves new functions to eprom (unless you disable that), so you don't have to reburn/reload constantly;
<lispmacs>
or, not EPROM: flash I meant
<lispmacs>
2. has RAM, Flash, and EPROM all mapped over one contiguous address space, for easy read/write to any (with option to disable flash/eeprom writes)
<lispmacs>
3. have used it for a while and haven't had any serious problems with it.
<lispmacs>
cons:
<lispmacs>
flashforth itself doesn't come with any protocols implemented beyond uart. So you have to implement SPI, I2C, etc. as needed. I find that if you are willing to study the datasheet, this isn't too hard to do, so maybe some of my work is helpful: https://librehacker.com/2021/01/30/flashforth-spi-328p/
<proteusguy>
mark4, let me know when you push your modes to x4.
<lispmacs>
it is all basically port based IO in the end
<lispmacs>
with setting some config registers
<lispmacs>
along the same vein, you don't have a set of "arduino" functions built-in, like digitalwrite. I started to implement those but found it made more sense just to work directly with the PORT, PIN, etc. registers as described in the data sheet. Might need to create some abstractions though if you are trying to make stuff portable across multiple MCs
<proteusguy>
nihilazo, major diff between AVR & 6502 is AVR is Harvard architecture - different code & data memories. 6502 has an unusual zero page feature that acts as a nice register file. AVR has a cleaner ISA and just about every instruction executes in a single cycle which is nice.
<lispmacs>
proteusguy: (two cycles)
<lispmacs>
proteusguy: thinking of the 328P, but not sure about their more modern chips
<lispmacs>
328P is two cycles for most instructions, but 328P is technically obsolete, replaces by the 328PB or something
<lispmacs>
I had one time I recall with flashforth that I was messing around a lot with the voltage on the board, and the interpreter got stuck in some weird garbage output mode, which couldn't be fixed by a simple reset. I had to reflash flashforth to fix it. wasn't a big problem for me, but made me wonder about production environments. but I suppose in production environment you would also be disabling flash writes, burning
<lispmacs>
some more chip bits, and maybe disabling the interpreter, so i didn't want to rush to any judgments on stability
<lispmacs>
hope that is helpful for comparison with amforth
<nihilazo>
thanks
<lispmacs>
nihilazo: one other maybe bonus of flashforth is it is already available also for some PIC MCs if you want to play with PIC at some point
<lispmacs>
one caveat: I haven't actually got around to trying to build flashforth firmware myself; I've just been using the precompiled binaries that come with it, which feed right into avrdude
<lispmacs>
his build instructions were for some Windows compiler he was driving through wine, which was a little weird
<lispmacs>
Windows assembler, to be more accurate: avrasm2.exe
<nihilazo>
yeah that's something I find odd about amforth too, they seem to be using the windows avr assembler in wine
<lispmacs>
hopefully assembling with avr-gas instead is not too painful
<lispmacs>
or something
<lispmacs>
haven't looked into it yet
<lispmacs>
but I think all the code needed is there
<siraben>
If software has changed license from GPL to proprietary, it's still fine to fork the last GPL commit right?
<lispmacs>
siraben: yes
<siraben>
lispmacs: ok, great.
<siraben>
I hate it when upstream gets bought out
<lispmacs>
siraben: hmm, yeah, if they own the author's rights now, they can change the license. But they can't take away permissions that have already been given on released code
shmorgle has quit [Quit: [TalkSoup] via NEXTSPACE]
<lispmacs>
assuming there is only one author
<lispmacs>
if it was a work were a lot of people contributed, you might have a legal basis for opposing them changing the license of the whole project
<lispmacs>
in which case I might send an email to the SFLC
shmorgle has joined #forth
f-a has joined #forth
<lispmacs>
asking for their opinion
<lispmacs>
I'm assuming you don't have your own team of lawyers to actually do anything about it. But SFLC is a team of lawyers which will do something about it for free, if they believe their is a solid legal case
<nihilazo>
I love source-based package managers for exactly this reason
<mark4>
proteusguy: im about to push was was done to x4 a while back, im not 100% sure what i was working towards withthem, there is one extension that needs a complete rewrite but thats not going to be difficult :)
<mark4>
but i dont think there are any real fixes in these pushes yet
dave0 has quit [Quit: dave's not here]
spoofer has quit [Remote host closed the connection]
spoofer has joined #forth
f-a has quit [Quit: leaving]
mirrorbird has joined #forth
gravicappa has quit [Ping timeout: 256 seconds]
gravicappa has joined #forth
f-a has joined #forth
Zarutian_HTC has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
rixard has quit []
rixard has joined #forth
gravicappa has quit [Ping timeout: 264 seconds]
mirrorbird has quit [Ping timeout: 246 seconds]
tech_exorcist has quit [Quit: tech_exorcist]
tech_exorcist has joined #forth
mirrorbird has joined #forth
neto has joined #forth
<neto>
anyone have experience with x4 forth and know how to get command line arguments?
<neto>
on gforth you'd use next-arg but that is not a word in x4
<mark4>
me i wrote it lol
<mark4>
there is actually an example of that in src/examples
<neto>
I am aware : )
<neto>
aight i'll read that thanks
<neto>
i'm looking into porting my text editor from gforth to x4
<neto>
should p pretty easy as it's only 150 lines of code
<mark4>
cool
<mark4>
showargs.f is what you are looking for btw
<mark4>
you might also want to look at src/ext/args.f
<neto>
so you use the normal C interface of argc and arg#
<mark4>
i pull argc and argv off the stack yes
<neto>
looks good, thanks
<neto>
mhm obv gforth does that too but provides a diff interface
<mark4>
you also used to be able to do a shebang in forth soruces but im not sure if that still works lol
<mark4>
#! /path/to/x4 foo bar bam fud
dave0 has joined #forth
<neto>
mark4: yep just tested it on gforth, still works
<mark4>
i mean in x4 i dont use g4th ever :)
<neto>
ah the fact the strings from arg@ are null terminated is quite annoying
<veltas>
Why is that "quite annoying"?
<neto>
does x4 use counted strings?
<mark4>
thers a strlen that will convert asciiz to ( a1 n1 --- )
<mark4>
yes but the environment and command line args are asciiz
<neto>
well because most forth words don't act on null terminated strings veltas
<mark4>
you can do create foo ," a counted string"
<mark4>
or create bar ,' a non counted non terminated string' 0 c, <-- you have to terminate it
<mark4>
which is what you hVe to do for file creation etc
<mark4>
the file syscalls want an asciiz file name
<veltas>
neto: It's trivial to write a word to get a u form from a null-terminated string, and also x4 apparently already has this word
<neto>
right, when I wrote a little linux forth I just used null terminated strings for everyything
<neto>
veltas: I am aware it's trivial, it's still less than ideal
<veltas>
I don't know "quite annoying" seems a bit strong
f-a has quit [Quit: bb]
<veltas>
I'm not trying to tone police here just confused by that specific reaction
<mark4>
some things annoy the FREEEEEK out of me lol
<neto>
"quite annoying" is pretty light in my books, but maybe I useed it wrong
<mark4>
like autotools generating a Makefile with a SPACE separator
<mark4>
grrr
<veltas>
What instead of tab characters?
<mark4>
yea
<neto>
thought you hated tab chars mark4 ?
<mark4>
it took me 2 hours just to figure out why the FUCK it was not creating a Makefile in the first place
<veltas>
They're required by make
<mark4>
neto i do but Makefiles required tabs
<mark4>
which is utterly moronic
<neto>
I wouldn't know, I just use tabs all the time : )
<mark4>
tabs are the spawn of satan :P
<neto>
I must be Satan himself with how many i've spawned then!
<neto>
what's your gripe with them
<veltas>
I like tabs, don't know your issue. But we banned them at work because it's easier to write a script to ban tab characters from source than bad alignment or mismatched tab size use
<mark4>
they clusterfuck up any soruce file containing them
<mark4>
guaranteed
<veltas>
People are really bad at not butchering whitespace in general
<veltas>
We got fed up with every code review being held up by people misusing spaces and tabs
<neto>
just enforce 8 char long tabs like Linus did
<mark4>
you have a tab size of 8, i have a tab size of 2. so someone does tab tab tab tab foo(); and now the sources are
<mark4>
CLUSTERFUCK
<mark4>
8 char tabs are also idiotic
<neto>
your fault for having a tab size of 2
<mark4>
they eat up too much realestate that shoul be dedicated to comments on the right
<mark4>
source here
<mark4>
comment here
<veltas>
8 char tabs are conventional
<mark4>
source here
<mark4>
comment here
<mark4>
is also clusterfuck
<mark4>
should be
<mark4>
source here comment here
<mark4>
the convention is wrong
<veltas>
No thanks mark4, comments at end of line are bad
<mark4>
i disaagree because i can now scan down the left column and ignore the right column
<mark4>
or vice versa
<veltas>
Colours
<mark4>
the eyes scan vertically much better than they do horizontally which is why newspapers publish in tall thin columns
<mark4>
yes there is a u in colour
<neto>
my problem with end of line comments is that they often go over the 80 char limit and so are hard to read
<veltas>
Funny because I find newspapers harder to read than source code
<mark4>
i enforce 75 chars but 80 is ok
<mark4>
its a soft rule, i can go slightly over
<neto>
well don't you often run into needing more space?
<veltas>
I have come to associate comments at the end of a line with bad code
<veltas>
The point of tab characters is to make it easier to tabulate. On a typewriter 8 was a good choice, which is where the convention comes from.
<veltas>
Indentation and tabulation are two different things though
<veltas>
I prefer indent of 4, 2 feels like a 'clusterfuck' to me
<neto>
I indent with 8 and I use tabs, bringback from C ig
<neto>
mark4: what's the -s option?
<neto>
same as -f, no?
<mark4>
is that in the shebang?
<mark4>
i htink you need to not use -f in the shebang but -s but its been so long i cant remember why lol
<mark4>
something to do with running default FIRST i think
<neto>
wdym running default?
<mark4>
you can do ./x4 -f src/examples/dots/wmdots.f
<neto>
yeah it is in the shebang
<mark4>
there is a default init chain
<mark4>
there are actually 3 default init chains
<neto>
you don't have it listed in the help output btw
<mark4>
yea forgot about that lol
<neto>
and you have a typo in the help output :p
<mark4>
in the shebang you have to use #! x4 -s foo bar bam
<mark4>
yea i have typos all over lol
<neto>
smh
<cmtptr>
mark4, is #! a word that just ignores to the newline?
<neto>
not him but it should be, yeah cmtptr
<mark4>
yes
<neto>
just line the comment \ word
<neto>
like*
<cmtptr>
heh, cool. that's how i did it in mine too
<neto>
mark4: is there any examples for files?
<neto>
just simple open, close, read-line, etc
<mark4>
not really, there is fload but its not a trivial example
<mark4>
all of that was meant to go in ext/file.f eventually
<mark4>
some of it is in there
<neto>
i'll just read file.f then, np.
<mark4>
look at fload.f too
<neto>
is <open> the linux syscall? can I just use that if I wanna pass a null terminated string then?
<neto>
I only see an fload.s mark4
<mark4>
oh right lol
<mark4>
that one
<mark4>
but its basically a .f file passed to nasm
<neto>
file.f seems to be enough for what I need
<mark4>
kk
<neto>
I just need open, read, read-line and write-line
<neto>
actually, where do you define the permissions?
<mark4>
n the open call :)
<mark4>
i did not define them in any sources, its on the todo list, i usually just hard code them for now
<mark4>
i have a problem with leaving deadwood in binaries, one of the things im planning is a transient vocabulary
<mark4>
where #defines for things like file permissions etec can all be put
<mark4>
they exist in that voc till you do a turnkey and then that entire vocabulary is deleted
<mark4>
thats why i have my const word
<mark4>
0 const zero
<mark4>
will act like a var (value) except in compile mode when it compiles itself as a literal
<neto>
switching vocabularies? yeah that's in the ANSI standard I believe
<mark4>
but the definition for zero still exists... i want things like that in a transient vocab that is thrown away later
<mark4>
i have vocabularies
<mark4>
you know how headerless words work right?
<mark4>
you create headerless words but they are creaed with headers and you can call them till you behead
<mark4>
i want to be doing something similar with the CODE
<neto>
yes I think that is called markers in ANSI forth?
<mark4>
well markers exist here to they are part of forget
<mark4>
the problem is. i want to be able to forget JUST what definitions are in a specific voc
<mark4>
if you do marker blah then create 286592458 definitions
<mark4>
then do blah you forget blah and everything above it
<mark4>
not what im thinking of
<mark4>
i want to be abl eto forget this keep this forget this forget this keep this keep this keep this.... interleaved as it wer
<mark4>
by putting all the words i eventually want to forget in their own vocabulary in their own memory spae
<neto>
yeah just use a separate colon definition that defines into a separate vocabulary that gets erased every time behead is called
<mark4>
transient definitons..... define a lot of constants myvoc defintions... creatae a lot of code that uses the constants then DUMP the definitons for the constants
<neto>
instead of all the previously defined functions with marker
<neto>
I see what you mean
<mark4>
because all of the references to them will have been compiled as literals not references to the constant word
<mark4>
behead only discards headers not the code itself
<mark4>
i have <headers (from headers) and headers> (headers to)
<neto>
mhm, what object oriented folk would call private and public functions
<neto>
ah so the words are still taking up that space in memory?
<mark4>
so i do <headers headerless words here headers> these words have headers <headers these ones dont and then i do behead
<mark4>
YES!!!
<mark4>
the reason for headerless words is so you dont polute namespace
<mark4>
and also you make words "private" to the module they are defined in
<mark4>
so module B cannot call "private" words defined in module A
<mark4>
because there are no headers for them
<neto>
yeah they're private functions like in OOP
<mark4>
but all the words in module A that referenced them can still do so
<neto>
mhm the pointers are still valid
<mark4>
yes the execution tokens pointing to the code are still valid
<neto>
yeah I think the ANSI system for doing that is more restrictive
<mark4>
what i want to be able to do is have words created in a special voc with has a special buffer for both their headers and their code
<mark4>
and then just blow away that vocs buffers entirely on demand
<mark4>
when you create a structure in xr4
<mark4>
x4
<mark4>
struct: blah
<mark4>
db foo
<mark4>
dw bar
<mark4>
;strut
<neto>
why do you use <header and header> instead of a special colon definition? like :headerless or something
<mark4>
BLAH is a constant which defines the SIZE of the structure
<mark4>
foo is an offset into the structure and bar is an offset
<mark4>
they are simply constants
<neto>
yeah ik how forth structs work
<mark4>
because i think of <headers and headers> as pointing towards the code with headers
<mark4>
and i find them to be far less visually cluttering
<neto>
oh okay. I found it p confusing when I first saw them
<mark4>
:headerless bllah blah blah ;
<mark4>
:headerless bllah blah blah ;
<mark4>
:headerless bllah blah blah ;
<mark4>
:headerless bllah blah blah ;
<mark4>
instead of <headers ... lots of CLEAN defs. ... behead
<neto>
maybe a better name would be :priv or something like that
<mark4>
nope. i do have m: for macro definitions, self inliing colon defs
<neto>
or, what abou <headers = private, headers> = public
<mark4>
but i dont use special-colon-word-to-create-headerless-words: blah lots of forth code here ;
<mark4>
because that would absolutely CLUSTER FUCK up the sources
<mark4>
i find my way much cleaner
<mark4>
i hate c because of all the BULLSHIT (type) casging you have to do
<mark4>
(int) fuge = 5;
<mark4>
ugh
<mark4>
hate that shit
<mark4>
i want to see fudge = 5;
<mark4>
less NOISE
<neto>
I find the choice of words for <headers and headers> poor, prefer private and public, much more clear what is going on : )
<neto>
yes ofc I agree, the beauty of forth is how clean and noise free the code is, if written properly
<mark4>
you can define ' <headers alias private ' headers> alias public
<neto>
are you agreeing with me those are better names? :p
<mark4>
nope
<mark4>
im not disagreeing with you though :)
<neto>
but yeah doesn't matter much, just confusing at first
<mark4>
im saying... if you want those definitions its trivial and free to define them
<neto>
are you taking the 5th on this one?
<mark4>
an alias is simply a second header on existing code
<mark4>
you dont create a new definition, you are simply creating a new symbol for an existing definition :)
<mark4>
: foo 100 0 do i . loop ;
<mark4>
' foo alias bar
<neto>
I am aware mhm
<mark4>
hyou dont get TWO definitions for foo, you simply get two headers :)(
<neto>
but we don't want a dozen words for the same thing, do we now!?
<mark4>
so.. define your private/public aliases :()
<mark4>
its harmless, its only head space and if it makes the code more readable to you... . .
<neto>
what's the length of PAD btw?
<mark4>
as long as you need it to be basically
<mark4>
pad is defined as here 256 + i believe
<mark4>
the only thing you need to be careful of is the fact that when you are creating headerless words the buffer for them is 8k or 16k? above here
<mark4>
so once you start making headerless words you have to behead before here catches up to where your headerless word headers are being compiled to
<mark4>
:)
<neto>
yeah your fname>pad word doesn't do any bound checking
<mark4>
lol im good at not doing bounds checking :)
f-a has joined #forth
<mark4>
im an expert :)
<neto>
I'll just say opening a file with a name over 256 bytes is "undefined behaviour", no worries B-)
<neto>
mark4: uh so is there any reason why <open> would be returning 4 things instead of just one file descriptor??
<neto>
and one boolean ofc
<neto>
wait no it isn't even supposed to return a boolean
<mark4>
show me your use case?
<neto>
i'm basically doing "arg@ <open>"
<neto>
with some code to check if arg@ returns a 0