<rdrop-exit> the implication being that the word commas (lays down) code into the dictionary
<rdrop-exit> but it's not a universal practice
<veltas> Also supposedly increases readability for multiple instructions on one line
<veltas> I don't have too strong an opinion on this, will add commas if I feel like it at some point
tabemann has joined #forth
dave0 has joined #forth
<tabemann> and I got multiline entry working!
<tabemann> (it should have worked from the beginning, but there was a bug that was corrupting the stack between lines entered)
<tpbsd> nice
* tabemann should fix string literals
<rdrop-exit> cool
<tpbsd> rdrop-exit! g'day!
iyzsong has joined #forth
<rdrop-exit> hello Forth Master Technician (tm)!
<tpbsd> some days I feel like a junior technician, but not today ;-)
<tabemann> what'd'ya do?
<tpbsd> today I think I will get the stm32 'touch sensing' working
<tpbsd> it's ready to go, the config is done, I just need to enable the interrupt
<rdrop-exit> excellent
<tpbsd> I've revamped my cortex-m interrupt' page at last: https://mecrisp-stellaris-folkdoc.sourceforge.io/interrupts.html#interrupts
<tpbsd> hopefully it's a bit more sensible now
<tpbsd> Ive added tips I found critical in the page
<rdrop-exit> kudos
<tpbsd> the cortex-m interrupts are a bit more complex than my old 8 bitters :)
X-Scale` has joined #forth
gravicappa has joined #forth
X-Scale has quit [Ping timeout: 255 seconds]
X-Scale` is now known as X-Scale
<tabemann> okay, gonna head home - bbl
<rdrop-exit> ciao tabemann
tabemann has quit [Ping timeout: 255 seconds]
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
jsoft has joined #forth
gravicappa has quit [Ping timeout: 255 seconds]
tabemann has joined #forth
dddddd has quit [Ping timeout: 260 seconds]
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
<tabemann> hey guys
<tpbsd> hey tabemann
<tabemann> does anyone know how to get gdb to disassemble when the PC is in no known function?
<tpbsd> not me
<tabemann> okay, figured it out
_whitelogger has joined #forth
<tpbsd> the generated code is the same size, I think the "bit" makes it less wordy, more readable
_whitelogger has joined #forth
dys has joined #forth
dys has quit [Ping timeout: 255 seconds]
dys has joined #forth
iyzsong has quit [Ping timeout: 255 seconds]
iyzsong- has joined #forth
iyzsong has joined #forth
iyzsong- has quit [Ping timeout: 240 seconds]
_whitelogger has joined #forth
<jsoft> You're wordy
dave0 has quit [Quit: dave's not here]
_whitelogger has joined #forth
xek has joined #forth
WickedShell has quit [Remote host closed the connection]
dddddd has joined #forth
<veltas> Do people spend a lot of time refactoring Forth to make it as short as possible?
<tpbsd> probably
<tpbsd> Forth does engender efficiency
<veltas> I feel like I am refactoring a lot as I go to keep the code more readable
<tpbsd> yeah me too
<tpbsd> i think it becomes a bit of an obsession
<veltas> I think it is to do with how difficult the code becomes to understand when it's not properly factored
<tpbsd> absolutely
<veltas> It is a good thing in a way, but it does remind me a lot of how I write assembly as well
<tpbsd> agreed
<veltas> I can see why people compare the experience to writing assembly
gravicappa has joined #forth
<tpbsd> well Forth covers the entire spectrum
<tpbsd> from assembly like to hll
<veltas> Hmm
<tpbsd> from "0 bit I2C1_CR1 \ I2C1_CR1_PE, Peripheral enable"
<tpbsd> to "on fill wash spin off"
<tpbsd> Forth always looks different, C, Python, assembly always looks the same
<tpbsd> and so on
<tpbsd> in a way 'reading Forth is like reading in a dream where the writing is always changing"
<veltas> I like how the high level examples are always washing machines
<tpbsd> Thats only so C coders can follow the example ;-)
<veltas> lol
<tpbsd> we cant use it on micropython coders as they dont know what a washing machine is
<veltas> One of the things I liked about Lua was the flexibility and ability to create a pseudo-DSL
<tpbsd> but lua isnt as flexible as Forth is in area ?
<veltas> Er I think the way it's not as flexible is mostly not important
<veltas> Like it's true that Forth is more powerful here but mostly in ways that don't matter
<tpbsd> I mean, C user washing machine is like this "on(); fill(); wash(); spin(); off();"
<veltas> You can define +.... but not redefine + for numbers etc
<veltas> In Lua it would be "on() fill() wash() spin() off()"
<tpbsd> whats the washing machine look like in lua ?
<tpbsd> ahh
<veltas> But you could also write it like "plan{on, fill, wash, spin, off}"
<tpbsd> the brackets really mess with the PDL imho
<veltas> And numerous other ways
<tpbsd> some think it is the language that makes the solution possible
<veltas> Well if you want an example of a total failure at using Lua as a DSL have a look at awesome window manager's rc.lua
<crc> re: short words; I try to keep things compact, but not if it makes things harder to read and understand.
<tpbsd> crc, agree
<tpbsd> i have no problem with massively long words if needed
<veltas> An example of a bad attempt to use Lua as a DSL
<tpbsd> long enough to explain the function without ambiguity, but no longer
<veltas> Even the C file that Lua file is based on is more readable and DSL-like https://git.suckless.org/dwm/file/config.def.h.html
<veltas> Really sad
<tpbsd> hahah
<tpbsd> I liked Lua personally, but not for embedded
<veltas> This is a good example of Lua as a DSL https://leafo.net/guides/dsl-in-lua.html
<tpbsd> people have been trying to replicate Forth functionality a lot lately, and failing imho
<veltas> If you used the spacing of their DSL example you could probably write a reimplementation of what they had in Forth
<veltas> Changing the strings slightly to start with " or something
<tpbsd> but what do you get when you alter LUA to behave exactly like Forth ? ... Forth!
<veltas> Well Lua was designed from the start as a DSL writer
<veltas> And it's based on their in-house work
<veltas> It's a sequel to SOL
<veltas> When they originally wrote it the language was not aimed at programmers
<veltas> Forth is actually aimed at programmers
<tpbsd> i tested elua a while back
<tpbsd> http://www.eluaproject.net current V0.9 260KB minimum flash needed, cant run on cortex-m0
<veltas> If you are interested in the history and design of Lua then you should read https://www.lua.org/doc/hopl.pdf
<tpbsd> Forth was made to control telescopes
<tpbsd> by an astronomer
<veltas> By the authors, interesting case of programming language design
<tpbsd> naturally to control any machinery with a computer, programming is needed
<veltas> Lua is a replacement for a DSL that was pretty much a Brazillian dBase replacement with simple validation on input
<tpbsd> aha
<tpbsd> I'm not interested in Lua now, I tested it on embedded but it's unsuitable for me
<tpbsd> I also tested micropython
<tpbsd> eLISP
<tpbsd> nothing is as suitable as Forth which is substantially smaller and faster than all of the above
<veltas> luajit is probably faster than Forth but how often does that matter
<tpbsd> Forth is perfect for small embedded I'm my opinion
<veltas> And it is very platform specific
<tpbsd> in my tests Forth is about 3x slower than C
<veltas> luajit is the reason Lua has as much interest as it does, a small project produced a JIT compiler that is better than the mainstream JavaScript JITs
<tpbsd> but then Forth is interactive and the compiler is built in
<veltas> Hmm
<tpbsd> so a 19kB Forth also includes the compiler
<tpbsd> no PC is needed
<tpbsd> you could use a dumb terminal, tho no one does thesedays
<tpbsd> the Forth development environment I use definitely needs a pc tho
<MrMobius> tpbsd, 3x faster on m0 for example?
<tpbsd> MrMobius, yes, thats what I used for my test
<tpbsd> 3x kept happening when I did comparisons and it's been mentioned in other literature
<tpbsd> but it's still only anecdotal in my case
<tpbsd> I find Forth on M3 is 3 - 4.8x faster than a M0 also
<tpbsd> but speed is rarely a issue for me
iyzsong- has joined #forth
iyzsong has quit [Ping timeout: 240 seconds]
rdrop-exit has quit [Quit: Lost terminal]
iyzsong- has quit [Quit: ZNC 1.7.1 - https://znc.in]
<MrMobius> tpbsd, interesting. im doing a C to forth comparison myself now
<MrMobius> did you use -o3 or -os?
<tpbsd> MrMobius, cool, be interesting to see your results
<tpbsd> I think I used the one that resulted in smallest code
<MrMobius> -Os then probably
<tpbsd> yes I think that was it
<tpbsd> my initial tests were mainly about binary code size
TwoNotes has joined #forth
xek_ has joined #forth
xek has quit [Ping timeout: 240 seconds]
<veltas> Fiance is learning programming, doing a Python tutorial. Did anyone here learn Forth as their first programming language?
<Kumool> pretty sure v8 is now equal to lua, but it required an entire team to produce a jit while lua was just one person
<veltas> I wonder how e.g. gforth compares to gcc
<Kumool> it doesn't
<Kumool> gforth is slower
<veltas> I know Forth is generally slower
<veltas> Although I can imagine that it could be as fast as or faster
<veltas> I know often JITs can be faster than compiled languages, so going off of that principle
<Kumool> you planning on building a JIT forth or something?
<veltas> No
<Kumool> I haven't written much forth, but I did try euler problem one in many forths, the fastest one was ficl, all the other ones were slow
<Kumool> slower than lua
<Kumool> not luajit either
<veltas> Hey lol that is what I was doing to learn Forth at the start
<veltas> Project Euler stuff
<Kumool> I didn't know how to use big numbers in forth so I gave up
<veltas> I just googled it and referred to gforth docs
<veltas> And then for arbitrary length integers I stopped and decided I would write my own eventually
<veltas> There is a big int for forth, I've seen it on github
<kori> JIT forth, now that's an idea
<veltas> Well by JIT forth all I mean is optimising your words
<MrMobius> seems like the benefit of a JIT to forth would be a lot less since youre not using many registers
<MrMobius> since one thing a JIT apparently does is decide what gets put in registers and what goes elsewhere like the stack
<MrMobius> (not a JIT expert though)
<veltas> Yeah but that is a good description for a normal language
<MrMobius> what do you mean?
<veltas> In Forth I think a lot of effort would go into figuring out which stack operations can be optimised out, and which stack contents can be done with registers instead of actually going to a stack
<veltas> An example is a function uses >R and then R>, well '>R' might as well just write to a register
<veltas> A word I mean sorry I can't break the habit
<Kumool> http://ficl.sourceforge.net/index.html Ficl also features blindingly fast "just in time" compiling, removing the "compile" step from the usual compile-debug-edit iterative debugging cycle.
<Kumool> my code doesn't work in it... the hell
<veltas> Forth is actually highly optimised inherently... for space. And that matters a lot more to me on my 8-bit computers.
<MrMobius> veltas, compared to what though?
<veltas> Did anyone here learn Forth as their first language?
<veltas> MrMobius: compared to native languages and assembly
<Kumool> I don't know what its doing, I just know its faster and has better performance than gforth
<Kumool> or it had, except now it doesn't work for some reason
<Kumool> wtf
<veltas> I am still enjoying Forth more than any other language in a while
dys has quit [Ping timeout: 260 seconds]
xek_ has quit [Ping timeout: 260 seconds]
<MrMobius> veltas, neat. which 8 bit system?
<veltas> ZX Spectrum
<MrMobius> nice
<kori> the zx spectrum would probably be nicer if it wasn't for the keyboard
<dzho> makes me wonder about https://en.wikipedia.org/wiki/Jupiter_Ace#ACE's_Forth
TwoNotes has quit [Quit: Leaving]
dddddd has quit [Ping timeout: 260 seconds]
<Kumool> I was wrong about ficl, its about the same
<Kumool> bah
<Kumool> even awk is faster than forth
<Kumool> ha
<Kumool> veltas: http://lua-users.org/lists/lua-l/2012-12/msg00289.html also this is how you build a DSL in lua
<Kumool> like wtf is that
<Kumool> that looks awful
<Kumool> its in pure lua, but its not gonna look great, because you're trying to hijack the parser
<Kumool> well, it looks fine, but still
<Kumool> also awesomerc.lua is not a DSL either, its pure lua... you can easily build a DSL in lua though, I built one for vis by just editing its visrc, the same could be done for awesome if you wanted to and make it more legible or just not use lua at all
<Kumool> visrc.lua http://tpaste.us/adOq DSL for keybindings: http://tpaste.us/qlpw
smokeink has joined #forth
gravicappa has quit [Ping timeout: 258 seconds]
dys has joined #forth
jsoft has quit [Ping timeout: 255 seconds]
<tabemann> Kumool: ficl isn't a native code Forth
<tabemann> whereas, say, the Forth I am working on is an SRT
<tabemann> /NCI Forth
xek_ has joined #forth
dddddd has joined #forth
jsoft has joined #forth
dave9 has quit [Quit: dave's not here]
tabemann has quit [Ping timeout: 240 seconds]
dave9 has joined #forth
dave0 has joined #forth
tabemann has joined #forth
xek_ has quit [Ping timeout: 255 seconds]
tabemann has quit [Ping timeout: 255 seconds]
tabemann has joined #forth