mark4 changed the topic of #forth to: Forth Programming | do drop >in | logged by clog at http://bit.ly/91toWN backup at http://forthworks.com/forth/irc-logs/ | If you have two (or more) stacks and speak RPN then you're welcome here! | https://github.com/mark4th
tabemann has joined #forth
tabemann has quit [Remote host closed the connection]
tabemann has joined #forth
tabemann has quit [Remote host closed the connection]
tabemann has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
jess has quit [Quit: Lost terminal]
jess has joined #forth
Zarutian_HTC1 has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
phadthai has joined #forth
sts-q has quit [Ping timeout: 240 seconds]
sts-q has joined #forth
Zarutian_HTC1 has quit [Remote host closed the connection]
phadthai has quit [Remote host closed the connection]
Zarutian_HTC has joined #forth
phadthai has joined #forth
mtsd has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
Zarutian_HTC has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
gravicappa has joined #forth
hosewiejacke has joined #forth
<proteusguy> Sussman (lead author of SICP) & Hanson have a cool new book just published that's pretty much the follow up of their years of teaching SICP at MIT. Software Design for Flexibility. https://www.goodreads.com/book/show/53730364-software-design-for-flexibility
<proteusguy> I just got it two days ago. Pretty good stuff. Here's a video that doesn't talk about the book but it is the very themes Sussman covers in it. https://youtu.be/cblhgNUoX9M
<proteusguy> Another video that has some of the same themes that I found quite interesting: https://youtu.be/xZmPuz9m2t0
<proteusguy> This stuff all applies to any language that treats data as code and code as data so quite useful for thinking in Forth.
dave0 has joined #forth
<hosewiejacke> Thx for mentioning. What language(s) does the book use for code examples?
<proteusguy> scheme of course. haha Sussman thinks in scheme it seems!
<hosewiejacke> Thx. I'd be surprised if if wouldn't have been Scheme :)
<proteusguy> It's truly the ultimate follow up to SICP. But you don't need to be an SICP fan to get some great insights.
hosewiejacke is now known as hwj
andrei-n has joined #forth
<KipIngram> I have to admit, it's getting easier for me to look at (Lisp like stuff) than it was a few days ago.
<KipIngram> I've by no means "got it" yet, but definite progress.
<KipIngram> That book does look pretty good too, proteus-guy.
<proteusguy> Writing a review of it now... :-)
<KipIngram> Cool.
<hwj> A review from a Forth guy perspective sounds interesting.
<KipIngram> I'm coming to more fully appreciate the... "kindred relationship" of the two languages.
<KipIngram> Lisp has the extra input information provided by the ( ... ) scopes. That allows a set of greater capabilities. The more or less total equivalence of code and data is definitely intersting.
<KipIngram> There's a lot of material in chapter 1 of SICP on numerical algorithms, and the ability to treat procedures like first class data items is definitely eye-opening. I've done a lot of numerical coding over the year, but saw some tricks in that section that I'd just never thought about before.
hwj has quit [Quit: Leaving]
<proteusguy> Lisp/Scheme basically try to hide the real machine from you whereas Forth insists that you be fully responsible for how your code gets executed and the resources it consumes. Otherwise they overlap in a lot of ways.
<KipIngram> If you imagined taking some Lisp code and "flipping it around" (from prefix to postfix, and then removed the ( ... ), you could "do" in Forth anything you could do in List - IF you could just just "automagically" decide to treat some of the code words as "data tokens" instead of code words. In Forth there's no easy way to do that, but it would get you close to the capabilities of Lisp.
<KipIngram> I'm scared to say it would get you all the way - I may be overlooking something at this early stage.
<proteusguy> You can easily implement a true List/Scheme in Forth. You can't go the other direction.
<KipIngram> Yes, that seems right to me.
<KipIngram> After all, you can do more or less anything in Forth.
<KipIngram> I'm just trying to put into words my notion so far of what the parentheses bring you in Lisp.
<proteusguy> Yeah but I mean do anything in a manner that Forth supports well and was designed for. Not just that I can hack it. Forth is really an ideal platform for building a List/Scheme.
<KipIngram> No, I agree with you.
<KipIngram> I wasn't quibbling it.
<KipIngram> Maybe another thing to note is that in Lisp which tokens are operators and which are operands is forced by their position in the input; in Forth that's totally up to the individual words. The distinnction arises in a completely different way in the two approaches.
<proteusguy> yeah I was just backing up my point so it wasn't misinterpreted. :-)
<KipIngram> Cool. :-)
<KipIngram> I've historically had no use/interest in Lisp, but... I guess I'm turning out not to be TOO old to learn a new trick. I'm seeing there's something here worth knowing.
<KipIngram> Quite a bit, probably.
<proteusguy> yes - what you say is exactly right and a capability of forth that I'm using extensively in ActorForth. Using contexts to determine how the compiler/interpreter work and making all that completely replaceable in a manner that isn't completely confusing is a core aspect of ActorForth.
<proteusguy> Skip Lisp. Just play with Scheme. That's my advice if you don't want to go insane from incompatible environments.
<KipIngram> Yes, I've already seen that. So many little differences. I was muddling around for a few days trying to get a "target system" to work with, and just this evening kind of gravitated to Scheme.
<KipIngram> Specifically scm on Ubuntu - as far as you know is that a good choice?
hosewiejacke has joined #forth
<proteusguy> I would refer all Scheme environment questions to siraben ! :-) He's the local expert. I rarely touch the stuff in an actual computer.
<siraben> proteusguy: Cool, Software Design for Flexibility is on my reading list
<siraben> I think emphasis for correctness and flexible design can go hand in hand, having rock solid primitives and ways to compose them matter a lot in making extensible yet correct software
<siraben> KipIngram: I don't know scm, but common choices are: chez, guile, chicken
<siraben> KipIngram: I like the numerical algorithms examples. Some people object to it, but it makes perfect sense for college first-years learning intro calculus to see higher order functions that way
<siraben> The mind blowing part for me was when they implemented a symbolic differentiator with pattern matching, that was neat
andrei-n has quit [Quit: Leaving]
tech_exorcist has joined #forth
koisoke has joined #forth
f-a has joined #forth
<cess11> racket is pretty convenient for learning a scheme
<cess11> decent ide, works well with both sicp and the book the racket gang approves of, how to design programs
<cess11> i use it whenever i want to build something with regular desktop gui and use picolisp for pretty much everything that resembles scripting or hacking in a posix environment
<koisoke> i haven't used plt scheme in aeons but i don't recall any particulary good gui bindings. has this changed?
<cess11> not sure what it's based on but it's exposed as object trees and message passing, https://docs.racket-lang.org/gui/
<koisoke> thanks
<cess11> for me it hits a sweet spot where i can quickly wrap some code or calls to the shell in buttons and windows as well as plop out a standalone binary with a couple of clicks
<siraben> koisoke: the Racket GUI library is awesome
<siraben> I've only have had pleasant experiences with it
f-a has left #forth [#forth]
andrei-n has joined #forth
andrei-n has quit [Remote host closed the connection]
<proteusguy> siraben, which one is the one described by the "Mit/Gnu Scheme Reference Manual"?
<siraben> proteusguy: that would be mit-scheme
<siraben> But I think mit-scheme is barely used in real projects, not that've heard of anyway
<siraben> Even Cisco had a use for Chez Scheme and were the maintainers of it for a while
<siraben> KipIngram: IIRC the first few chapters of SICP are relatively easy, there are some real head scratchers though
dave0 has quit [Quit: dave's not here]
<KipIngram> I'm probably not to the hard ones yet - it's been fairly easy to follow, just with a "perusal."
<KipIngram> A lot of numeric algorithms, and as I said I've done a lot of that.
<KipIngram> Look like at the beginning he spends a lot of time on the basica idea of "what do you get when you can abstract programs and data?"
<KipIngram> The data side of that was pretty familiar to me, but there were some new ideas brought in with "first class procedures."
<KipIngram> New to me, I mean.
<KipIngram> I guess a lot of languages provide data abstraction tools, but very few do the same for code.
<KipIngram> we were talking about Lisp in Forth last night - now that I slept and woke up, it seems like just having definitions of ( and ) and putting spaces around them would be almost enough to get you to a "postfix Lisp."
<KipIngram> You'd make everything else constants that left values on the stack, thenn the (...) history would tell you when to treat a word as an operator.
<KipIngram> And how far down the stack to dig for its operands.
<KipIngram> So ( 1 2 3 4 5 + ) would very nicely give you 15.
<KipIngram> Seems like all the smarts would be in )
<KipIngram> Literally everything else could just be constants.
<KipIngram> That actually seems more sensible than prefix to me - no worrying about stuff that hasn't arrived yet.
<KipIngram> When you need to act, EVERYTHING you need will be on the stack.
<KipIngram> You just scan down through it for a ( to figure out how much of it to take.
<KipIngram> So postfix Lisp would be "simpler" than prefix Lisp.
<KipIngram> siraben: I like those numerical examples too - it carried me through familiar roads with the new vehicle, which made focusing on the vehicle easier.
<KipIngram> Damn covid shot. I'm STILL waking up every morning with chest congestion that I have to cough out. Very minor, low-grade "got a cold" symptoms that seem to come around early evening. A couple of Tylenol take those out, though.
<KipIngram> I've heard it can last up to a week and not be "unusual."
<cess11> functions and macros are code abstractions, no?
<KipIngram> Well, sure. But there's the ability to pass procedures as parameters, and return them as values, that also comes with "first class" sttus.
<KipIngram> status
<cess11> there are some lisp-ish interpreters implemented in forth that you might want to look at, e.g. https://github.com/schani/forthlisp
<KipIngram> So yeah, most languages provide SOME code abstraction.
<KipIngram> This is just the first time I've seen it taken "all the way."
<KipIngram> And it's immediately evident to me that it adds a layer or two or three of capability.
<cess11> yeah, sure, first class functions/procedures, currying and so on is sometimes lacking
<KipIngram> In a couple of those numerical examples, they were doing conventional presentation of the algorithms in Lisp, and then they'd come to one and I'd look at it and think, "That looks like a pseudo-code description I might write down." Except here it's ACTUAL CODE.
<KipIngram> It can do stuff you can't quite do in say C.
<cess11> for sure
<KipIngram> I don't think I grasp it well enough yet to define it precisely, but I... "see" it.
<cess11> at least not without implementing something like a lisp interpreter first
<KipIngram> Sure, right.
<KipIngram> Oh, and proper indentation just makes it a LOT easier to look at.
<KipIngram> Lisp, that is.
<cess11> yeah, it's very readable compared to c-style languages, the list is similar to how written left-to-right natural languages tend to be interpreted
<cess11> same goes for forth but it's reversed due to the stack being lifo which trips some people up until they get used to it
<KipIngram> That's what I like about well-written, sufficiently factored Forth.
<KipIngram> It reads left-to right, and each line has its own meaning.
<KipIngram> So clean to look at.
<KipIngram> Of course, you can write Forth like C too, if you want to, but... yuck.
<KipIngram> I've become borderline obsessed with the whole factoring thing.
wineroots has quit [Read error: Connection reset by peer]
<KipIngram> Lately I'm averaging 35-40 chars per definition.
<KipIngram> I believe the "wisdom" that a short definition can be totally contained in your "short term memory" is spot on, lock stock and barrel.
<KipIngram> It does make it easier to keep up with what's going on.
<KipIngram> Plus I've started using conditional returns a lot, and some of them return multiple levels. So I'm actually using that "third dimension" as part of how I build control structures.
<KipIngram> Of course, that ties definitions together in a way they wouldn't otherwise be tied.
<KipIngram> But I'm 100% convinced it's overall shortening my code.
<KipIngram> By a good bit.
<cess11> depends a lot on context what's a good fit
<KipIngram> Just think of it for a minute - a conditional return is a fantastic way to implement IF ... THEN. Just put the ... in a new definition with a conditional return at the very start.
<KipIngram> That's just an elementary way of using them.
<KipIngram> Suddenly you don't NEED IF / THEN, and you wind up with more factored words to boot.
<KipIngram> IF THEN just gives you a way of making a definition longer that you ought to factor.
<KipIngram> Sure - it pays off more strongly in some places than others.
<KipIngram> I think the best payoff I've seen so far is in my dictionary search; my FIND implementation.
<KipIngram> For looping I also have "conditional jump to start of word."
<KipIngram> And that replaces pretty much all of the looping constructs.
<KipIngram> Finally, you can have a word that's an infinite loop with a conditional return out of it somewhere in the body.
<KipIngram> And with multi-level conditional returns, that last conditional return I mentioned can be in a lower level word.
<KipIngram> But it's purpose is still to push you back up out of an infinite loop word.
<KipIngram> That allows factoring of the end of loop code.
<KipIngram> I usually name such words with a ; at the end, to indicate they may cause a return.
<KipIngram> I haven't found enough value in multi-level return greater than two to define the words yet.
wineroots has joined #forth
f-a has joined #forth
<siraben> KipIngram: wow that's quite the reaction, I've never gotten such reaction from a flu vaccination but I guess it's not really comparable
<siraben> KipIngram: yeah the nice thing about numerical algorithms in functional languages is that it basically is executable pseudocode
<KipIngram> Yeah - more than I've ever had too. It's not "bad" - it's not like I've felt miserably ill at any point. It's low grade, but persistent.
<siraben> I read somewhere that the inert viral load is much higher in covid vaccines than necessary
<siraben> perhaps they weren't taking chances, but I don't want to speculate
<KipIngram> I don't think my words really conveyed the bit that impressed me, though - there were a couple of examples that just screamed "you can't do this in most languages" to me.
<siraben> Haha, show don't tell!
<siraben> the first lecture of SICP sold me in watching the rest
<KipIngram> Ok; I'll go back and try to find the one that gave me that reaction.
<KipIngram> In a little while.
<KipIngram> Misouri it, eh? Show me?
<KipIngram> Oh, there are videos?
<siraben> Most intro CS lectures show trivial programs, but here we are on the first lecture, writing a numerical algorithm to compute the square root!
<KipIngram> Shoot - I want to watch those too.
<siraben> Oh you must see them—they're magical.
<KipIngram> Got a handy link, or do I just search it down?
<siraben> looks like they recently (2019) re-encoded them from the VHS tapes https://www.youtube.com/watch?v=-J_xL4IGhJA&list=PLE18841CABEA24090
<KipIngram> I assume this is ...
<KipIngram> Thanks.
<siraben> Yep.
<siraben> the students are HP employees, that's why they are that old
<siraben> but it was also taught to first-years at MIT at the time, IIRC
<KipIngram> Groovy keen. I can count all that as required continuing education for work.
<KipIngram> Though I'm already way over this year.
<KipIngram> That winter storm that came through TX a couple of months ago had my lab equipment offline for nearly two weeks.
<KipIngram> Couldn't work.
<KipIngram> The nut of the problem was our IT guy just happened to resign just before the storm.
<KipIngram> He'd done all kinds of funky things to build his experience, but he didn't leave behind anyone who knew how to deal with it.
<KipIngram> So I spent that time on CE.
<KipIngram> Rather than just sitting on my hands.
<KipIngram> But yeah - the IT guy was really clever about it - his new gig is as director of IT for some outfit. He played it all really smart.
<KipIngram> Also got hitched with one of the better looking women from our office and made off with her too.
<siraben> Hah
<KipIngram> Wow - 1.5 minutes in and I'm already liking this guy.
<KipIngram> He seems a little nervous in front of an audience. I sympathize - I'm not really a "natural" up on stage either.
<KipIngram> Ok, siraben - he's touching on one of these cases right here in lecture 1. It's the transition from thinking of the fixed point box as something that takes in a number and gives you that numbers square root, to instead regarding it as something that takes in a particular PROCEDURE and gives you another PROCEDURE that is the procedure for finding the fixed point of that input procedure.
<KipIngram> It's easy enough to think of it that way, but in Lisp you actually can do that.
<KipIngram> It's a subtle thing. But I just found myself realizing it's really powerful.
<siraben> KipIngram: which time stamp is that?
<siraben> bbl, sleep
<cess11> can do stuff like currying also in ml-style languages
<cess11> personally i'm too fond of the data code equivalence to really get into haskell or whatever though, and the repl experience in them tends to be primitive at best
<KipIngram> Oh, I'm already well past it, but it's in there around 13-20 minutes in.
<KipIngram> cess11: You know, I never heard the term "currying" until just a few days ago.
<KipIngram> I've realized something in the last few days about my... "path." I'm a hardware guy by training, and as I learned more about software over the years it was almost always in the context of controlling hardware. Embedded design. Ok, that's great, and I think I'm quite good at it. But it does really only touch on some of the possibilities of software.
<KipIngram> Basically the side effects have ALWAYS been what I've been interested in - what is this code going to DO? I was never led to think about these more esoteric concepts, and I find myself looking very forward to broadening myself in the near future.
<KipIngram> Functional programming has always sort of baffled me - it just looks like math, and I've failed to see how you actually accomplish anything. But... I think I'm going to figure it out soon. :-)
<KipIngram> Fingers crossed.
<cess11> once you're somewhat fluent in a scheme, take a look at sbcl or some other decent common lisp implementation, there you can compile, recompile and debug assembly of functions in a running system, similar to but a bit more convenient than forth
kiedtl has quit [Ping timeout: 260 seconds]
kiedtl has joined #forth
kiedtl has quit [Changing host]
kiedtl has joined #forth
kiedtl_ has joined #forth
kiedtl_ has quit [Client Quit]
gravicappa has quit [Ping timeout: 252 seconds]
<lispmacs> how functional programming is /supposed/ to work is that you are supposed to write beautiful, elegant mathematical structures representing what you want to accomplish, and then a supergenious compiler or macro system comes a long and turns that into functional, highly efficient machine code
<lispmacs> like some chain of monads or arrows or whatever is the thing these days
f-a has quit [Read error: Connection reset by peer]
f-a has joined #forth
<KipIngram> See, that's hard for me - I want to know how the work is going to be done. I want to write down how I want the computer to do the work. :-)
f-a has quit [*.net *.split]
tech_exorcist has quit [*.net *.split]
phadthai has quit [*.net *.split]
mtsd has quit [*.net *.split]
tabemann has quit [*.net *.split]
kiedtl|ltbx has quit [*.net *.split]
xybre has quit [*.net *.split]
X-Scale has quit [*.net *.split]
spoofer_ has quit [*.net *.split]
remexre has quit [*.net *.split]
joe9 has quit [*.net *.split]
WilhelmV1nWeiner has quit [*.net *.split]
tolja has quit [*.net *.split]
ornxka has quit [*.net *.split]
cantstanya has quit [*.net *.split]
jevinskie[m] has quit [*.net *.split]
ecraven has quit [*.net *.split]
crc has quit [*.net *.split]
crest_ has quit [*.net *.split]
rann has quit [*.net *.split]
guan has quit [*.net *.split]
mark4_ has quit [*.net *.split]
lispmacs[work] has quit [*.net *.split]
cess11 has quit [*.net *.split]
Lord_Nightmare has quit [*.net *.split]
nitrix has quit [*.net *.split]
APic has quit [*.net *.split]
jedb has quit [*.net *.split]
DKordic has quit [*.net *.split]
rprimus has quit [*.net *.split]
siraben has quit [*.net *.split]
TangentDelta has quit [*.net *.split]
lispmacs has quit [*.net *.split]
Keshl has quit [*.net *.split]
xek has quit [*.net *.split]
cp- has quit [*.net *.split]
dsmcfarl has quit [*.net *.split]
veltas has quit [*.net *.split]
bluekelp has quit [*.net *.split]
clog has quit [*.net *.split]
djinni has quit [*.net *.split]
rprimus has joined #forth
DKordic has joined #forth
X-Scale has joined #forth
mtsd has joined #forth
tech_exorcist has joined #forth
spoofer_ has joined #forth
f-a has joined #forth
jedb has joined #forth
phadthai has joined #forth
remexre has joined #forth
tabemann has joined #forth
ornxka has joined #forth
tolja has joined #forth
WilhelmV1nWeiner has joined #forth
kiedtl|ltbx has joined #forth
xybre has joined #forth
joe9 has joined #forth
cantstanya has joined #forth
cantstanya has quit [Max SendQ exceeded]
cp- has joined #forth
siraben has joined #forth
TangentDelta has joined #forth
djinni has joined #forth
clog has joined #forth
siraben has quit [Max SendQ exceeded]
Keshl has joined #forth
dsmcfarl has joined #forth
veltas has joined #forth
lispmacs has joined #forth
bluekelp has joined #forth
xek has joined #forth
jevinskie[m] has joined #forth
ecraven has joined #forth
ovf has quit [Ping timeout: 250 seconds]
lispmacs[work] has joined #forth
cess11 has joined #forth
APic has joined #forth
nitrix has joined #forth
X-Scale has quit [Ping timeout: 246 seconds]
lispmacs has quit [Ping timeout: 266 seconds]
jimt[m] has quit [Ping timeout: 258 seconds]
crest_ has joined #forth
guan has joined #forth
crc has joined #forth
jevinskie[m] has quit [Ping timeout: 276 seconds]
X-Scale has joined #forth
ovf has joined #forth
rann has joined #forth
f-a has quit [Quit: leaving]
jimt[m] has joined #forth
jevinskie[m] has joined #forth
siraben has joined #forth
rpcope has quit [Ping timeout: 268 seconds]
X-Scale is now known as Guest60158
rann is now known as Guest45273
Lord_Nightmare has joined #forth
cantstanya has joined #forth
tech_exorcist has quit [Quit: tech_exorcist]
Zarutian_HTC has joined #forth
rpcope has joined #forth