00:00:00 --- log: started forth/21.01.12 00:12:55 --- join: hosewiejacke joined #forth 00:54:18 --- join: xek joined #forth 00:58:41 --- quit: tabemann (Remote host closed the connection) 01:18:02 --- join: dave0 joined #forth 01:28:04 --- quit: proteus-guy (Ping timeout: 260 seconds) 03:27:21 --- join: floatcom1lex joined #forth 03:28:00 --- quit: floatcomplex (Ping timeout: 264 seconds) 03:42:26 --- join: proteus-guy joined #forth 03:43:26 --- quit: hosewiejacke (Ping timeout: 256 seconds) 03:46:50 --- quit: proteus-guy (Ping timeout: 246 seconds) 03:47:58 --- quit: gravicappa (Ping timeout: 240 seconds) 04:07:02 --- join: jedb_ joined #forth 04:09:34 --- quit: jedb (Ping timeout: 256 seconds) 04:15:17 --- nick: jedb_ -> jedb 04:46:08 --- quit: Lord_Nightmare (Ping timeout: 272 seconds) 04:57:42 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. 04:58:56 lispmacs[work]: gforth is still 0.7.3 on Nixpkgs, heh 05:00:03 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. 05:03:46 TangentDelta: yay, Haskell :) 05:03:57 tabemann* oops 05:05:01 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 05:17:22 --- join: gravicappa joined #forth 05:33:43 --- join: Lord_Nightmare joined #forth 05:46:36 --- join: Wojciech_K joined #forth 06:04:36 --- quit: jedb (Ping timeout: 260 seconds) 06:19:57 --- join: jedb joined #forth 06:28:02 --- join: jedb_ joined #forth 06:30:50 --- quit: jedb (Ping timeout: 256 seconds) 07:12:54 --- nick: floatcom1lex -> floatcomplex 07:22:16 --- join: Zarutian_HTC joined #forth 07:57:27 --- quit: Zarutian_HTC (Ping timeout: 240 seconds) 08:08:31 Yay, Haskell! 08:19:15 Yay no haskell 08:19:42 is ghc still that crap? 08:20:01 a minor diff can make diff perfomance? 08:20:15 can you reason about performance with haskell TODAY? 08:20:48 I'll just stick to OCaml 08:21:20 also not sure what it has to do with forth 08:32:54 --- join: Zarutian_HTC joined #forth 08:33:11 TangentDelta: why yay haskell? 08:33:15 what's good about it? 08:33:23 do you have exp with OCaml? 08:33:24 ptrkriz: sure you can reason about haskell performance :P, also various profiling libraries and such, someone just brought up haskell in the backlog 08:33:35 there's a lot to like wrt. Haskell, I also like OCaml and SML for different reasons 08:34:02 because last time I looked at haskell, there were 2-3 diff ways to implement smth, minor diff, major perf hit 08:34:12 and Jane Street knew it too 08:34:37 (which is why they didnt choose haskell back then) 08:34:45 have you written programs in Haskell? 08:34:49 nop 08:34:54 Yeah I saw that mention in a Jane Street article 08:35:09 But too often people criticize that aspect without actually writing any Haskell, which is a shame 08:35:28 I don't know how much GHC has matured 08:35:50 FWIW my experience with Haskell is that performance is predictable, and GHC has knobs to toggle 08:35:52 siraben: also... I know you from other channels :> 08:35:56 it's very mature 08:36:00 ptrkriz: oh? which ones? 08:36:08 lojban I think 08:36:42 or a channel for people who speak lojban and such 08:36:45 Ah, I still lurk there but haven't touched it in years 08:36:55 owww 08:37:08 regarding Haskell: Its code looks someone overly extended Backus-Noir Form syntax 08:37:10 I still haven't learned it really 08:37:23 Zarutian_HTC: must be because of the pattern matches 08:37:23 I wanna learn Lojban so I could teach it to my children some day 08:37:46 siraben: yebb 08:37:54 that would be an interesting experiment, IIRC someone did that with vulkan but because only one parent was speaking it the child stopped responding 08:37:58 to vulkan* 08:38:03 siraben: have you ever wanted to pass Lojban through to your children or anyone else? 08:38:25 In trying to learn lojban for a few months, I found it hard in terms of vocab because it's that neutral 08:38:45 I read the official one, it makes sense and seems easy 08:38:53 but i had other stuff to do 08:39:01 i had an anki deck of lujvo 08:39:02 I mean it does seem logical 08:39:07 but the vocab didn't really stick 08:39:10 I recommend the Wave Lessons too 08:39:13 .i mi djica lo lojban 08:39:20 and you just put this and that there, and you know why 08:39:48 but in natural languages? fuck if I know xD 08:40:02 Sanskrit is pretty logical 08:40:07 * Zarutian_HTC still does not grasp monads fully 08:40:30 lmaoo there r great and funny vids explaining monads 08:40:39 Zarutian_HTC: pragmatically it's just a design pattern, if you've seen null chaining, promises before, it's like that but generalized 08:41:00 sanskrit is good at shortening stuff. 08:41:10 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 08:41:19 man, we are in #forth and there's no talk of Forth! goddamit 08:41:33 anyone uses Forth? 08:41:40 all roads lead to forth, eventually P 08:41:45 ptrkriz: https://github.com/siraben/zkeme80 08:41:56 Zarutian_HTC: may be enlightening https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/ 08:41:58 siraben: as someone who has been up to his eyeballs in E where js promises comefrom I think I understand your analogy 08:42:03 as long as your "master" is not "main", siraben ;p 08:42:20 ptrkriz: ? 08:42:22 ah looks nice 08:42:27 though the io monad of haskell escapes me 08:42:33 siraben: github forced "master" -> "main" 08:42:38 Zarutian_HTC: think of it like promises again 08:42:41 and git suggests it too nowadays 08:42:44 It's opt-out IIRC yeah 08:43:14 because muh slavery but i never thought about slavery.. *context* 08:43:23 I don't mind, i've seen staging/trunk/master/main whatever 08:43:36 siraben: like eventual send chaining on a promise to an io virtual device? 08:44:16 siraben: that's actually pretty cool 08:44:27 * Zarutian_HTC uses "prime" as the "master" replacement, just to fuck with people 08:44:47 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 08:45:39 hah recommended starting forth by leo brodie, such a common, along with Thinking Forth 08:45:39 Master branch never invoked slavery in my mind, as compared to master/slave terminology in EE/concurrency which is more explicitly so. 08:45:54 Yeah, starting forth is great, I followed along in gforth 08:45:58 * Zarutian_HTC just abuses js with org(), def(), and dat() for assembly purposes 08:46:04 I read thinking forth twice because I've been doing C most of my life 08:46:21 Zarutian_HTC: re IO monad: yeah sort of 08:46:42 siraben: thanks btw 08:46:44 for sharing 08:47:02 ptrkriz: np :) Forth is great 08:47:20 instead of actions you perform now you sort of "suspend" the computation, again, pragmatically what this gives is that control structures are just functions! 08:47:40 when b m = if b then m else return () 08:48:05 this is like, #define when(b,m) (if(b){m;}) 08:49:15 but when is a function as opposed to a macro 08:54:30 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) 08:55:20 and children of slaves were never considered slaves themselfs 08:55:44 anyway io monads 08:57:05 Zarutian_HTC: did that make sense? it's like promises or suspended computations 08:57:29 I try to recast quite a few control flow patterns meant for use in data processing as dataflows and ops on that instead 09:00:27 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 09:04:33 so an io monad is like the result of const line = ioport~.readLine(); cobst first = line~.split(" ")~.[0]; 09:04:43 const* 09:05:17 ~. being tildot, the eventual send operator proposed for js 09:07:17 ( 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) 09:11:10 Right, ok. So in Haskell that would be 09:11:40 first = do { x <- readLIne; return (head (lines x)) } 09:11:53 deliberately imperative "look and feel" 09:14:25 the diffrent look and feel does not bother me that much 09:26:16 * Zarutian_HTC has dealt with task sequencing via ladder logic, interlocks, rom logic, imperative programming, declaritive programing, and finite state machines 09:28:36 and oh, also via .then sausages, async/await functions, and old style callbacks 09:35:58 --- quit: Bahman (Quit: Connection closed) 09:36:06 --- quit: Zarutian_HTC (Remote host closed the connection) 09:40:05 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 09:40:05 ssible to supposedly super-smart, complicated compilers. 09:42:51 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 :) 09:47:53 --- join: Zarutian_HTC joined #forth 09:52:46 --- quit: dave0 (Quit: dave's not here) 09:57:11 --- quit: Zarutian_HTC (Remote host closed the connection) 09:58:14 --- join: Zarutian_HTC joined #forth 10:38:27 GHC has an interactive mode 10:39:30 --- quit: Zarutian_HTC (Remote host closed the connection) 10:51:35 --- quit: gravicappa (Ping timeout: 260 seconds) 10:53:11 --- join: gravicappa joined #forth 11:49:38 lispmacs[work]: interesting, I use the REPL a _lot_ in Haskell for interactive development 11:50:57 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 11:51:26 siraben: is the repl built-in, or something you loaded separately? It has been quite a few years to be honest 11:52:20 lispmacs[work]: definitely it's been there for at least a decade I'm willing to wager, run `ghci` 11:52:34 oh, okay, that sounds familiar 11:52:45 even, `ghci file.hs` to load up a file 11:53:35 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` 11:53:58 sorry, yes, I did not remember that 11:54:26 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 11:54:31 definitions* 11:54:41 s/software/code 12:01:47 you can also try "stack ghci" if thats how youre doing it 12:01:56 in Haskell, I recall I very quickly became dependent on GHC specific extensions to get the type system to do things I wanted 12:03:18 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 12:30:16 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 12:36:09 that seems not so good if you have to ship the compiler as your runtime lib 12:55:33 proof of concept? 12:57:50 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 12:58:03 obviously it can be done, but not with the compiler alone 12:58:11 --- quit: gravicappa (Ping timeout: 264 seconds) 12:58:41 maybe "often" is a stretch, but more than once 12:58:42 seems like a good job for python 12:58:59 ive done it in assembly and forth and used vb to do it for C 12:59:23 yeah, you end up having to build a tool to generate your c 12:59:54 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 13:10:54 --- join: Zarutian_HTC joined #forth 13:14:30 --- join: WickedShell joined #forth 13:21:38 --- quit: Zarutian_HTC (Remote host closed the connection) 13:32:18 I just got flashforth burned to a 328pu 13:33:17 running on an Arduino Uno 13:34:48 how do ISRs work in forth 13:35:41 i'm mentally trying to visualize blink without delay in forth 13:36:52 floatcomplex: the details for the atmel target on in the paragraph `Interrupt handling' on this page: https://www.flashforth.com/atmega.html 13:37:17 you store an interrupt word's xt in the interrupt vector 13:37:43 and have to have an initialize word for boot 13:37:56 i.e., for after reset 13:38:09 ' my_irq 10 int! 13:38:15 : irq_init ['] my_irq 10 int! ; 13:38:15 ' irq_init is turnkey 13:39:10 oh that page says r14/15 are already a millisecond counter so blink without delay doesn't require writing an isr 13:41:30 nice thing about flashforth vs arduino-fvm is the new words are saved across resets 13:41:36 by default 13:41:56 and you can access all three memory spaces with normal @ style access 13:45:08 however, you are not allowed to redefine words. you have to use `marker', or the `empty' word 13:46:15 to forget words you have defined 14:00:25 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 14:00:42 looks like it's about 60 instructions in c: https://godbolt.org/z/G4Y83K 14:02:08 the actual math is just eight adds and eight subs, the rest is just moving values around 14:04:00 seems like it would be straightforward to test it out 14:04:34 hmm, actually maybe not if you dont have an avr set up 15:15:29 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 15:17:33 but of course overhead might depend on the Forth implementation 15:18:42 lispmacs[work]: take a look at that godbolt link i sent, it's just sixteen total add/subtract operations 15:22:05 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 15:28:46 yeah i only mention it because porting some more generic length-N fft code might not be an apples to apples comparison 15:52:08 --- nick: jedb_ -> jedb 15:56:04 proteusguy: Wow that is interesting, what did you do with OLPC? 16:17:30 cmtptr: I have thought about the static hash table thing too, I haven't gotten around to it but I want to get C to generate C code (i.e. C that is built before everything else, or with special #defines) to do stuff like that 16:17:35 Because who needs python? 16:18:50 Have you encountered gperf? It's a GNU tool for generating perfect hash functions/tables (i.e. so you can store everything in an array and do an unconditional hash lookup) 16:19:41 floatcomplex, could you reimplement it in forth then send it to lispmacs[work] to test on the avr setup? 16:20:10 floatcomplex, just guessing though it will be at least 5x slower than C and maybe 10x or more 16:22:18 veltas, yes i know about gperf, but i was thinking more about a hash table that's implemented by the program being compiled and can change at runtime 16:22:31 that was just one example case that i've encountered in the past 16:22:50 I do know exactly what you're talking about though 16:27:49 MrMobius: i'm not the right person to do that and have it be a good indication for how fast the forth version could be 16:28:01 i'll be the first to admit that 16:28:35 I think my idea is that if you build C code that generates e.g. files containing initializer lists to #include in your .c files, with the pre-generated state that you can't achieve otherwise, then you have the benefit of being able to depend on your existing headers/etc in that generation code 16:28:47 Rather than replicating definitions in e.g. Python 16:30:03 Something you get for free in Forth 16:31:55 i think forth does something special where it isn't a compiler, it's an interpreter and just so happens to define words which lay down compiled code or build data structures to compile them later. i've put a lot of thought into how to take that concept to something more c-like, but i think it's too fancy a problem for my tiny brain 16:41:13 Yep Forth makes my head hurt a lot too, it's a draw 16:41:35 It has changed how I write code in every other language 16:47:19 veltas, why not do that in Python though? arent you reading C source files in whether you do it in C or Python? 16:48:25 floatcomplex, just curious, what makes you wonder about the speed on an avr? lots of advantages to forth but you usually give up a lot of speed. kind of like other languages where you have a trade off 16:49:20 MrMobius: e.g. if I have tons of definitions, or I want to use my library functions to generate initial data, I don't want to maintain a Python version of all that 16:50:56 --- join: Zarutian_HTC joined #forth 16:53:14 veltas, I guess it depends on what youre trying to do but what I meant was scanning in C source and making changes to it in Python 16:53:30 not rewriting an equivalent Python program to calculate things at compile time 16:55:32 I'm thinking of generating C source, rather than modifying it. I.e. generating the initial state of a struct. Trying to change source inline is a bit too messy for me, outside of preprocessor macros 16:57:05 ahh 17:11:58 --- quit: remexre (Ping timeout: 240 seconds) 17:13:09 --- join: remexre joined #forth 17:15:54 --- quit: Zarutian_HTC (Remote host closed the connection) 17:30:11 --- quit: WickedShell (Remote host closed the connection) 17:32:10 --- join: dave0 joined #forth 18:45:59 --- join: boru` joined #forth 18:46:01 --- quit: boru (Disconnected by services) 18:46:04 --- nick: boru` -> boru 18:57:28 --- join: tabemann joined #forth 19:00:46 lispmacs[work]: I know where that paper is 19:00:59 "Type Level Instant Insanity", probably 19:02:03 https://wiki.haskell.org/wikiupload/d/dd/TMR-Issue8.pdf 19:03:49 MrMobius: asking because i've done the fibonacci benchmark and it's kinda too trivial to care. a 4-point fft primitive is actually useful 19:05:24 my best-effort forthlike interpreter on avr is about 20x slower than native c code to do the same thing, but it's such an artificial benchmark that it might not be fair to forth 19:05:41 (the fibonacci benchmark) 19:13:05 --- join: X-Scale` joined #forth 19:13:10 --- quit: X-Scale (Ping timeout: 272 seconds) 19:13:14 --- join: NorthStar` joined #forth 19:14:24 --- nick: X-Scale` -> X-Scale 19:16:31 --- quit: NorthStar` (Quit: HydraIRC -> http://www.hydrairc.com <- s0 d4Mn l33t |t'z 5c4rY!) 20:06:08 --- quit: sts-q (Ping timeout: 265 seconds) 20:15:48 --- join: sts-q joined #forth 20:19:12 veltas, re: OLPC - I was aware of it from attending an earlier PyCon in Dallas. Of course python was a big part of it. My participation was lobbying the Thai govt to adopt it and I was prepared to assist on the roll out. I only played with one for a while and didn't write any code for it although I intended to (with my staff) but it got canceled after the coup. So my involvement ended up being cut short before doing anything 20:19:12 interesting. 20:19:43 proteusguy: is OLPC still alive in other countries? 20:20:12 siraben, if it is I haven't heard about it for several years. 21:15:10 floatcomplex, I see what you mean. I was more curious as to why you wanted to know how fast forth is. do you have something in mind you want to do with it or just curious so you know in case you ever want to use it? 21:33:36 --- join: gravicappa joined #forth 21:33:46 --- quit: WilhelmVonWeiner (K-Lined) 21:52:51 MrMobius: mostly the latter, and mostly because if such a benchmark is written for flashforth, i can in turn see how good my forthlike interpreter is on avr by comparison 21:54:37 although it's hard to say where to draw the line, w/r implementing the math primitives in C/asm and gluing them together in forth, vs implementing them from nothing in forth 22:02:02 floatcomplex, there are a few things you can do to speed things up like buffering the first item or two on the stack in registers 22:03:25 --- join: proteus-guy joined #forth 22:05:21 --- quit: dave0 (Quit: dave's not here) 23:20:06 proteus-guy: do you know what kinds of issues they ran into? was it not feasible to create low powered laptops? 23:59:59 --- log: ended forth/21.01.12