dave0 has joined #forth
dave0 has quit [Quit: dave's not here]
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
Zarutian_HTC has joined #forth
Zarutian_HTC1 has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
sts-q has quit [Ping timeout: 272 seconds]
sts-q has joined #forth
WickedShell has quit [Remote host closed the connection]
gravicappa has joined #forth
hosewiejacke has joined #forth
proteus-guy has joined #forth
Zarutian_HTC1 has quit [Remote host closed the connection]
joe9 has quit [Ping timeout: 264 seconds]
joe9 has joined #forth
hosewiejacke has quit [Ping timeout: 264 seconds]
hosewiejacke has joined #forth
xek has joined #forth
tabemann has quit [Remote host closed the connection]
dave0 has joined #forth
proteus-guy has quit [Ping timeout: 260 seconds]
floatcom1lex has joined #forth
floatcomplex has quit [Ping timeout: 264 seconds]
proteus-guy has joined #forth
hosewiejacke has quit [Ping timeout: 256 seconds]
proteus-guy has quit [Ping timeout: 246 seconds]
gravicappa has quit [Ping timeout: 240 seconds]
jedb_ has joined #forth
jedb has quit [Ping timeout: 256 seconds]
jedb_ is now known as jedb
Lord_Nightmare has quit [Ping timeout: 272 seconds]
<proteusguy> veltas, yeah I was involved in OLPC here in Thailand. But then we had a coup and the new govt killed it because it was an ideal from the prior govt. Good times.
<siraben> lispmacs[work]: gforth is still 0.7.3 on Nixpkgs, heh
<siraben> There's a number of packages lacking a git tag in Nixpkgs and have something like unstable-2020-11-03 in their version instead, based on the last commit on the main branch.
<siraben> TangentDelta: yay, Haskell :)
<siraben> tabemann* oops
<siraben> wrt. building languages from scratch, Forth is definitely more bare metal but with some work it's not difficult to implement Lisp from scratch as well, or even a language with an unusual operational semantics like Haskell
gravicappa has joined #forth
Lord_Nightmare has joined #forth
Wojciech_K has joined #forth
jedb has quit [Ping timeout: 260 seconds]
jedb has joined #forth
jedb_ has joined #forth
jedb has quit [Ping timeout: 256 seconds]
floatcom1lex is now known as floatcomplex
Zarutian_HTC has joined #forth
Zarutian_HTC has quit [Ping timeout: 240 seconds]
<TangentDelta> Yay, Haskell!
<ptrkriz> Yay no haskell
<ptrkriz> is ghc still that crap?
<ptrkriz> a minor diff can make diff perfomance?
<ptrkriz> can you reason about performance with haskell TODAY?
<ptrkriz> I'll just stick to OCaml
<ptrkriz> also not sure what it has to do with forth
Zarutian_HTC has joined #forth
<ptrkriz> TangentDelta: why yay haskell?
<ptrkriz> what's good about it?
<ptrkriz> do you have exp with OCaml?
<siraben> ptrkriz: sure you can reason about haskell performance :P, also various profiling libraries and such, someone just brought up haskell in the backlog
<siraben> there's a lot to like wrt. Haskell, I also like OCaml and SML for different reasons
<ptrkriz> because last time I looked at haskell, there were 2-3 diff ways to implement smth, minor diff, major perf hit
<ptrkriz> and Jane Street knew it too
<ptrkriz> (which is why they didnt choose haskell back then)
<siraben> have you written programs in Haskell?
<ptrkriz> nop
<siraben> Yeah I saw that mention in a Jane Street article
<siraben> But too often people criticize that aspect without actually writing any Haskell, which is a shame
<ptrkriz> I don't know how much GHC has matured
<siraben> FWIW my experience with Haskell is that performance is predictable, and GHC has knobs to toggle
<ptrkriz> siraben: also... I know you from other channels :>
<siraben> it's very mature
<siraben> ptrkriz: oh? which ones?
<ptrkriz> lojban I think
<ptrkriz> or a channel for people who speak lojban and such
<siraben> Ah, I still lurk there but haven't touched it in years
<ptrkriz> owww
<Zarutian_HTC> regarding Haskell: Its code looks someone overly extended Backus-Noir Form syntax
<ptrkriz> I still haven't learned it really
<siraben> Zarutian_HTC: must be because of the pattern matches
<ptrkriz> I wanna learn Lojban so I could teach it to my children some day
<Zarutian_HTC> siraben: yebb
<siraben> that would be an interesting experiment, IIRC someone did that with vulkan but because only one parent was speaking it the child stopped responding
<siraben> to vulkan*
<ptrkriz> siraben: have you ever wanted to pass Lojban through to your children or anyone else?
<siraben> In trying to learn lojban for a few months, I found it hard in terms of vocab because it's that neutral
<ptrkriz> I read the official one, it makes sense and seems easy
<ptrkriz> but i had other stuff to do
<siraben> i had an anki deck of lujvo
<ptrkriz> I mean it does seem logical
<siraben> but the vocab didn't really stick
<Zarutian_HTC> I recommend the Wave Lessons too
<siraben> .i mi djica lo lojban
<ptrkriz> and you just put this and that there, and you know why
<ptrkriz> but in natural languages? fuck if I know xD
<siraben> Sanskrit is pretty logical
* Zarutian_HTC still does not grasp monads fully
<ptrkriz> lmaoo there r great and funny vids explaining monads
<siraben> Zarutian_HTC: pragmatically it's just a design pattern, if you've seen null chaining, promises before, it's like that but generalized
<joe9> sanskrit is good at shortening stuff.
<siraben> if you want to know what it is, there's only three laws and the functor requirement, but knowing how to use it is another question heh
<ptrkriz> man, we are in #forth and there's no talk of Forth! goddamit
<ptrkriz> anyone uses Forth?
<siraben> all roads lead to forth, eventually P
<Zarutian_HTC> siraben: as someone who has been up to his eyeballs in E where js promises comefrom I think I understand your analogy
<ptrkriz> as long as your "master" is not "main", siraben ;p
<siraben> ptrkriz: ?
<ptrkriz> ah looks nice
<Zarutian_HTC> though the io monad of haskell escapes me
<ptrkriz> siraben: github forced "master" -> "main"
<siraben> Zarutian_HTC: think of it like promises again
<ptrkriz> and git suggests it too nowadays
<siraben> It's opt-out IIRC yeah
<ptrkriz> because muh slavery but i never thought about slavery.. *context*
<siraben> I don't mind, i've seen staging/trunk/master/main whatever
<Zarutian_HTC> siraben: like eventual send chaining on a promise to an io virtual device?
<ptrkriz> siraben: that's actually pretty cool
* Zarutian_HTC uses "prime" as the "master" replacement, just to fuck with people
<siraben> ptrkriz: yeah so that was a project i did in high school, implementing an assembler for Z80 in Scheme (because existing assemblers SUCK for metaprogramming), then implementing Forth on top
<ptrkriz> hah recommended starting forth by leo brodie, such a common, along with Thinking Forth
<siraben> Master branch never invoked slavery in my mind, as compared to master/slave terminology in EE/concurrency which is more explicitly so.
<siraben> Yeah, starting forth is great, I followed along in gforth
* Zarutian_HTC just abuses js with org(), def(), and dat() for assembly purposes
<ptrkriz> I read thinking forth twice because I've been doing C most of my life
<siraben> Zarutian_HTC: re IO monad: yeah sort of
<ptrkriz> siraben: thanks btw
<ptrkriz> for sharing
<siraben> ptrkriz: np :) Forth is great
<siraben> instead of actions you perform now you sort of "suspend" the computation, again, pragmatically what this gives is that control structures are just functions!
<siraben> when b m = if b then m else return ()
<siraben> this is like, #define when(b,m) (if(b){m;})
<siraben> but when is a function as opposed to a macro
<Zarutian_HTC> the "master" thing is very USA centric, in old Viking times the owner of slaves was called þrælari or goð (depending on their status)
<Zarutian_HTC> and children of slaves were never considered slaves themselfs
<Zarutian_HTC> anyway io monads
<siraben> Zarutian_HTC: did that make sense? it's like promises or suspended computations
<Zarutian_HTC> I try to recast quite a few control flow patterns meant for use in data processing as dataflows and ops on that instead
<Zarutian_HTC> hmm.. a promise is a place holder for a future value. It can resolve later and dependant actions on it can be postponed and those give immediately back promises for their values
<Zarutian_HTC> so an io monad is like the result of const line = ioport~.readLine(); cobst first = line~.split(" ")~.[0];
<Zarutian_HTC> const*
<Zarutian_HTC> ~. being tildot, the eventual send operator proposed for js
<Zarutian_HTC> ( it is like . but the method call/index access and such happens in a later event-loop-turn but you get a promise for the result immediately)
<siraben> Right, ok. So in Haskell that would be
<siraben> first = do { x <- readLIne; return (head (lines x)) }
<siraben> deliberately imperative "look and feel"
<Zarutian_HTC> the diffrent look and feel does not bother me that much
* Zarutian_HTC has dealt with task sequencing via ladder logic, interlocks, rom logic, imperative programming, declaritive programing, and finite state machines
<Zarutian_HTC> and oh, also via .then sausages, async/await functions, and old style callbacks
Bahman has quit [Quit: Connection closed]
Zarutian_HTC has quit [Remote host closed the connection]
<lispmacs[work]> I wrote a video game in Haskell once, years ago. It is certainly an interesting language. The part I really struggled with though is when your compiler, type system, and abstractions are much more difficult to understand than what you are trying to code, and you certainly don't feel close the hardware. Haskell seems like an extreme version of what Chuck Moore didn't like - programmers trying to offload as much as po
<lispmacs[work]> ssible to supposedly super-smart, complicated compilers.
<lispmacs[work]> I don't recall running into anything remotely like an interactive experience in Haskell. I recall a very heavy use of the one debugging-print word that would return any type the type-system wanted :)
Zarutian_HTC has joined #forth
dave0 has quit [Quit: dave's not here]
Zarutian_HTC has quit [Remote host closed the connection]
Zarutian_HTC has joined #forth
<MrMobius> GHC has an interactive mode
Zarutian_HTC has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 260 seconds]
gravicappa has joined #forth
<siraben> lispmacs[work]: interesting, I use the REPL a _lot_ in Haskell for interactive development
<siraben> And yes, the sense of feeling close to the hardware is lost (unless you're using the unsafe primitives and FFI, I suppose), but one gains the ability to write super generic code, it's a tradeoff
<lispmacs[work]> siraben: is the repl built-in, or something you loaded separately? It has been quite a few years to be honest
<siraben> lispmacs[work]: definitely it's been there for at least a decade I'm willing to wager, run `ghci`
<lispmacs[work]> oh, okay, that sounds familiar
<siraben> even, `ghci file.hs` to load up a file
<siraben> crazily enough, I learned in 2020 about a flag you can pass to the compiler to defer type errors to runtime (!), `ghc foo.hs -fdefer-type-errors`
<lispmacs[work]> sorry, yes, I did not remember that
<siraben> I guess like Forth, you can do a lot of pointfree software in Haskell, but unlike Forth you can choose whether or not to be pointfree or pointwise with your definitoin
<siraben> definitions*
<siraben> s/software/code
<MrMobius> you can also try "stack ghci" if thats how youre doing it
<lispmacs[work]> in Haskell, I recall I very quickly became dependent on GHC specific extensions to get the type system to do things I wanted
<lispmacs[work]> like, I was diving into the idea that I could write my whole program as a transformation of types, but then the core type system proves to be not quite sufficient
<lispmacs[work]> I had downloaded a paper a while ago where somebody wrote a rubiks cube solver that used only type system transformations. I.e., once you finished compiling the program, the problem was solved. but I can't find it now
<cmtptr> that seems not so good if you have to ship the compiler as your runtime lib
<MrMobius> proof of concept?
<cmtptr> yeah, i get it. i've often found myself wishing i could do stuff like that in c, like for example to populate a hash table with initial values at compile time
<cmtptr> obviously it can be done, but not with the compiler alone
gravicappa has quit [Ping timeout: 264 seconds]
<cmtptr> maybe "often" is a stretch, but more than once
<MrMobius> seems like a good job for python
<MrMobius> ive done it in assembly and forth and used vb to do it for C
<cmtptr> yeah, you end up having to build a tool to generate your c
<MrMobius> ya which doesnt bother me as long as it's just scanning for a #pragame or tag of some type and leaving everything else alone
Zarutian_HTC has joined #forth
WickedShell has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
<lispmacs[work]> I just got flashforth burned to a 328pu
<lispmacs[work]> running on an Arduino Uno
<floatcomplex> how do ISRs work in forth
<floatcomplex> i'm mentally trying to visualize blink without delay in forth
<lispmacs[work]> floatcomplex: the details for the atmel target on in the paragraph `Interrupt handling' on this page: https://www.flashforth.com/atmega.html
<lispmacs[work]> you store an interrupt word's xt in the interrupt vector
<lispmacs[work]> and have to have an initialize word for boot
<lispmacs[work]> i.e., for after reset
<lispmacs[work]> ' my_irq 10 int!
<lispmacs[work]> : irq_init ['] my_irq 10 int! ;
<lispmacs[work]> ' irq_init is turnkey
<floatcomplex> oh that page says r14/15 are already a millisecond counter so blink without delay doesn't require writing an isr
<lispmacs[work]> nice thing about flashforth vs arduino-fvm is the new words are saved across resets
<lispmacs[work]> by default
<lispmacs[work]> and you can access all three memory spaces with normal @ style access
<lispmacs[work]> however, you are not allowed to redefine words. you have to use `marker', or the `empty' word
<lispmacs[work]> to forget words you have defined
<floatcomplex> how many clock cycles is a 4-point complex-to-complex fft (using signed 8-bit integers for each of the real and imaginary components) in forth on avr
<floatcomplex> looks like it's about 60 instructions in c: https://godbolt.org/z/G4Y83K
<floatcomplex> the actual math is just eight adds and eight subs, the rest is just moving values around
<MrMobius> seems like it would be straightforward to test it out
<MrMobius> hmm, actually maybe not if you dont have an avr set up
<lispmacs[work]> floatcomplex: MrMobius: i have an avr set up with flashforth, but I don't have fft code handy. Most AVR instructions are 2 clock cycles, including generic memory fetches throughout ram (including the registers). There are special i/o instructions available for a few of the registers, which are 1 clock cycle
<lispmacs[work]> but of course overhead might depend on the Forth implementation
<floatcomplex> lispmacs[work]: take a look at that godbolt link i sent, it's just sixteen total add/subtract operations
<lispmacs[work]> floatcomplex: I don't have time at work here to reimplement right now, but I could play with it at home or at my next lunch break
<floatcomplex> yeah i only mention it because porting some more generic length-N fft code might not be an apples to apples comparison
jedb_ is now known as jedb
<veltas> proteusguy: Wow that is interesting, what did you do with OLPC?