dave0 has joined #forth
cnidario has quit [Remote host closed the connection]
lisbeths has joined #forth
WickedShell has quit [Remote host closed the connection]
dave0 has quit [Quit: dave's not here]
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
<lisbeths> so in line 306 of jonesforth what is .macro
<lisbeths> is that like an assemble-time macro?
<Zarutian_HTC> starts with a dot so I presume it is an assembler directive
<Zarutian_HTC> in this case of defining an assembler macro
<lisbeths> I assume it is the assembler equivalent of a c macro
<Zarutian_HTC> jebb pretty much a textual macro
<lisbeths> then what is lodsl
<Zarutian_HTC> (not like Scheme 'hygenic' macro)
<crest> lisbeths: you can find more about the assembler's docs
<lisbeths> I need to understand jonesforth pls pls pls pls pls.
<lisbeths> When I go to #assembler they just give me the intel x86 manual which is dense and impossible to understand
<Zarutian_HTC> wtf x86!
<lisbeths> I did a control f and did not find lodsl on there
<Zarutian_HTC> I think it might be LOaD String Long but not sure
<Zarutian_HTC> or LOaD String Literal
<crest> lisbeths: please provide a link to the line of jonesforth you're stuck at
jsoft has joined #forth
<lisbeths> It's in my terminal I don't know if it exists anywhere on the internet. It's line 307 but I had just wondered what loadsl means. I had assumed it meant stack l so I was way wrong.
<crest> grep through the code and find if it's a macro if it's not an instruction
<lisbeths> no its an assembler instruction
<lisbeths> I just don't know where it get sthe string literal from and where it saves it to
<Zarutian_HTC> what does the full line saym
<Zarutian_HTC> say?*
<lisbeths> the line says
<lisbeths> tab character lodsl newline
tangentstorm has joined #forth
<crc> lodsl and lodsd should be the same instruction iirc
<crc> iirc, gas uses different names for these than the intel manuals
<crest> stupid at&t vs intel wars
* crc is *very* rusty on his x86 assembly these days
<Zarutian_HTC> isnt x86 going to be eol-ed/deprecated in two decades or so?
<remexre> one can only hope
<Zarutian_HTC> what I recall regarding isa design is that you do not want hardwired cisc but, if it is required code densuty wise, dynamically updateable micro code on byte code basis.
<crc> I only ever needed to deal with a small subset of the x86 instructions
<Zarutian_HTC> how small a subset?
<crc> less than 50 are needed to implement retro's vm (counting each encoding as a unique instruction)
lisbeths has quit [Ping timeout: 244 seconds]
<Zarutian_HTC> that reminds me. Do you use double-printing-quine trick when making the c include file with the retro image?
<crc> as taken from a quick scan of https://github.com/crcx/impexus
<crc> no tricks involved, I use a program to convert the retro image into C when building
<Zarutian_HTC> ah, I see
<crc> how does the trick work?
<Zarutian_HTC> perhaps I am wierd but I would like to release my vm+image as single .c file with compile instruction in a comment near the top of the file
<Zarutian_HTC> a double printing quine prints itself in two ways. Once as an the text and inside that as data literal
<crc> generated daily by a cron job, using http://forth.works/examples/amalgamate.retro.html
<crc> I should have it insert the compilation instructions though; I hadn't thought of doing that...
<Zarutian_HTC> neat
<Zarutian_HTC> but the nice thing about doing the double-printing-quine way is that one could, from inside the program running on the vm, emitt a new .c with the current contents of the memory
<Zarutian_HTC> of the vm.
* crc has added build instructions in the generated amalgamation
<crc> that is something I'll experiment with when I return to working on the retro-compiler, thanks
<Zarutian_HTC> also, this means that inside retro you can have the option of reconfigure the vm constants for the next incarnation
<crc> yes, this would potentially make the compiler a lot more useful :)
<mark4> crc what are you working on now?
<crc> mark4: still working on retro
<mark4> when I return to working on the retro-compile <-- whats the difference lol
<crc> the current retro-compiler only works on systems using ELF binaries, I'd like to have more options in the future
<mark4> stand alone? windows PE ?
<crc> current projects are work on an implementation of my vm in apples swift language, and an experimental vm with support for simple multitasking
<crc> windows is one, also macos
<mark4> i could never develop for windows or macos, i would not want to learn the APIs on either platform lol
<crc> macos console stuff is mostly posix, desktop ui stuff is quite different
<mark4> yea its a unix like os i guess
<crc> windows I kind of have to tolerate at work, so I may as well be able to use my language on it
<mark4> you do windows dev at work?
<crc> not much, but on occasion
<mark4> i would do it if i was ever asked but i would tell them up front i would be doing that windows dev in linux under wine :)
<mark4> and learning it from the ground up
<crc> I develop the order management system we use, which is a web based thing running on a Linux server
<mark4> yea thats anohter thing i would have extreme difficulty with, web devel :)
<crc> we have to use windows for some programs (I don't have control over this)
<mark4> but i always tell my employers "Not in my job description" is not in my job description
<crc> it's not that bad. All processing is done on the server, with a bit of HTML to make it look reasonable for the users
<crc> There's a few iOS devices that serve as print servers for shipping labels
<mark4> what product is shipped?
<crc> (a growing amount of the server side code is written in retro; the original prototype was python and php)
<crc> we sell electrical supplies
<mark4> they LET you do it in retro?
<mark4> !
<mark4> or you just snuc it in?
<crc> for this, yes :)
<crc> I was asked to write something for this as the enterprise tool we were using sucked
<mark4> maybe they would let you sell that software to other corporations?
<crc> no limits were placed on me for the languages or technologies used
<mark4> usually you are told "do this in this way"
<crc> hard to say, we haven't discussed that
<mark4> being told "do this" leaves wiggle room :)
* crc is the only progammer in the company
<mark4> that can leave wiggle room too :)
<mark4> nobody else understand what you do so cannot direct you HOW you do it
<crc> I generally get asked to write some small tools, *how* they are written doesn't matter as long as they do the needed tasks
<mark4> hope they pay you well to do your hobby :)
<mark4> i just bought an updated license for IDA Pro and the debugger is literally saving me from the HELL of having to use GDB
<mark4> well sort of, it uses gdb internally but the interface is USABLE
<crc> ~$20/hour, plus overtime (which is most of it, as I work 40 hour weeks, so a lot of the coding gets done in the evening after work)
<mark4> no other gdb interface is even close to usable
<mark4> they are not paying you enough
<mark4> i have 50 an hour and 25 of that is not even taxable
<mark4> ever
<mark4> however, i have to suffer developing on a microchip product using microchip tools
<mark4> you should talk to my agency, they might be able to find you better paying work near you
<crc> I'm not a contractor though, just a standard employee who also does a bit of coding when I'm able (due to the longstanding RSI issues)
<mark4> yea
<crc> assuming I'm eventually able to deal with the rsi, I'll be interested to do more computer work. Now's not a good time for that though, when I frequesntl have long periods where the pain is too much to type more than a few words.
<mark4> how much will it cost to get that sorted
<mark4> ?
<Zarutian_HTC> crc: you tried submerging your arms in warm water and use one of those waterproof vibro motors (or whatever they are called) for relief?
<crc> Potentially? ~13k (my insurance dedeuctable), excluding the fact that I wouldn't be able to work for 2-6 months depending on how I heal after the surgery
<mark4> if it hurts too much to type more than a few words stop after one word
<mark4> or sooner
<crc> Zarutian_HTC: no, I've not heard of that
<Zarutian_HTC> the idea is that the whole hand tub vibrates like a subwoofer during dubstep
<mark4> also try peppermint oil on the areas that are hurting, its long been known to help with pain and it smells awesome :)
<mark4> and it repells spiders :P
<crc> Zarutian_HTC: I'll look into that
<crc> mark4: I use peppermint oil on my beard, haven't noticed any improvement to the pain in my hands (I rub in on my hands before applying to the beard) as a result, but it does smell nice
<Zarutian_HTC> the idea is massages like those massage chairs or devices but instead of one localized spot it goes the whole arm length
<mark4> oh yea its also anti bacterial and anti viral too
<mark4> awesome stuff
<Zarutian_HTC> as massages do, it stimulates bloodflow and possibly lymphfluid flow and production of ?tendion lubricating fluid?.
<Zarutian_HTC> one local programmer I know recommends slathering your hands and possibly forearms with aloe vera gel but I do not know about that
<Zarutian_HTC> one other trick he recommends is to fold a towel underneath your keyboard to minimize impact injury from typing
<Zarutian_HTC> (absorbs a bit of the pushing down key energy)
<crc> aloe vera: can't say I've noticed anything from that ( I use that on sunburns); but will try the towel idea
gravicappa has joined #forth
mark4 has quit [Ping timeout: 256 seconds]
Zarutian_HTC has quit [Ping timeout: 264 seconds]
gravicappa has quit [Ping timeout: 240 seconds]
gravicappa has joined #forth
Zarutian_HTC has joined #forth
lisbeths has joined #forth
jsoft has quit [Ping timeout: 246 seconds]
lisbeths has quit [Remote host closed the connection]
Zarutian_HTC has quit [Remote host closed the connection]
_whitelogger has joined #forth
mark4 has joined #forth
john_cephalopoda has joined #forth
<john_cephalopoda> Hi
<proteusguy> howdy
<proteusguy> I've finally got pattern matching working in ActorForth - but now it means I have to be able to differentiate generic types at compile time to keep my word lookup working.
<proteusguy> Thinking of syntax with leading underscores for type identification. like swap : _a _b -> _b _a
<proteusguy> Before I just had an "Any" type so it was swap : Any Any -> Any Any - which, of course, makes it impossible to understand what the stack picture will be after it executes.
<john_cephalopoda> You got types in your forth?
<proteusguy> I have forth in my types! ;-) Built the type system first, then a forth on top of it.
<proteusguy> I recall some literature a long time ago that described how to determine the optimal stack manipulation operations to convert from one pattern (say a,b,c,d) to another (say d,c,a,b). Wonder if I should just build a solver as a native feature.
<john_cephalopoda> What types have you got?
<proteusguy> right now just atom, int, and bool. But you'll be able to build any kind of types you like.
<john_cephalopoda> And how do you keep track of the stack elements' and variables' types?
<john_cephalopoda> Or do you just implement them in operations?
<proteusguy> stack objects all have types and values. so it's explicit on the stack.
<john_cephalopoda> Oh, so every stack element is practically a tuple?
<mark4> data types are a crutch for poor programmers --- Chuck Moore ---
<mark4> :)
<mark4> lol
<john_cephalopoda> Hey mark4!
<mark4> hi lol
<proteusguy> each type has its own dictionary. whatever type is on tos() sets the context of what dictionary will be checked first before the global one.
<mark4> proteusguy, how do you handle words that return different numbers or different types?
<mark4> different number of values i mean
<proteusguy> mark4, yeah Chuck likely won't be adopting ActorForth. ;-)
<proteusguy> mark4, that's presently forbidden.
<mark4> ( x y --- [ a b c ] | [ d e ] )
<mark4> aha
<mark4> he probably would never use my forth either - during the DOS days he used the same forth i did, FPC by tom zimmer and he HATED it lol
<mark4> i once talked to Linus T about my forth compiler, he said he knew forth but did not like it because it had no data types
<mark4> i dont think linus t is a poor programmer lol
<mark4> maybe he is an exception to that rule :)
<proteusguy> just very different contexts.
<mark4> ya
<mark4> i told him the advantage of forth was that because it used 2 stacks the parameters were not buried under the return value so you could return any number of items
<mark4> he said he had a friend who was working on a dual stack c implementation
<mark4> that was like over 10 years ago
<proteusguy> Probably back in the Transmeta or whatever that was days.
john_cephalopoda has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
<mark4> yea i think it was about that time :)
<mark4> linus t does not have a job now, he just gets paid to do his hobby :)
john_cephalopoda has joined #forth
<john_cephalopoda> Oof, gcc ate my memory
<john_cephalopoda> proteusguy: Is there a way to run ActorForth without the excessive output?
<mark4> heh
<john_cephalopoda> I tried compiling webkitgtk and that ate over 12 GB of RAM, which shot down my box. Thrice.
<john_cephalopoda> Imagine how much Forth you could store in 12 GB!
<crest> john_cephalopoda: 12GB
<crest> scnr
<john_cephalopoda> *shrug*
<crest> compiletoflash unused . compiletoram unused . 67164 17520 ok.
<crest> gcc and clang do a lot more than any forth compiler i know
<crest> but given how much mecrisp acomplishes in 20kB flash and a few kB ram ...
<crest> it feels so wrong to waste 12GB that way
<john_cephalopoda> I don't think it's really gcc's fault. Rather a really unoptimized compilation process.
<john_cephalopoda> 21M of gzipped tarball, ~half a GB when ungzipped. So it's holding 24x the entire source code in memory during compilation. Wow.
<john_cephalopoda> 226M when gunzipped to be exact.
<crest> that's c++ templating for you
_whitelogger has joined #forth
<proteusguy> john_cephalopoda, haha I'll be taking care of that once I have this core feature done. Sorry about the verboseness.
mtsd has joined #forth
<john_cephalopoda> mark4: Didn't you write that x86 compiler that uses traditional-order words (i.e. "MOV EAX, EBX" instead of "EAX EBX MOV")?
<john_cephalopoda> *assembler, not compiler
gravicappa has quit [Ping timeout: 246 seconds]
mtsd has quit [Quit: Leaving]
<mark4> on am aarch64 system, GCC object code has 2/3 wasted with just reg to reg moves.
<mark4> going to call a function first do 8 or 9 reg to reg moves, then call the funciton and move them all back again
<mark4> inside the function the first thing you do is reg to reg mvoes....
<mark4> john_cephalopoda, i was working on it - my AVR assembler is that way
<john_cephalopoda> Right, it was AVR :)
<john_cephalopoda> How did you do the backpatching? I remember you talking about it some time ago but I didn't quite get how it worked.
<john_cephalopoda> My assembler used to be two-pass with the first pass calculating addresses. Now it's single-pass and I maintain a linked list for every label in which I store the points where it's referenced. But it has some downsides, so I wonder how other people do it.
<mark4> well i can post the sources and go over them in detail wtih you - I do some black magic in there lol
<mark4> erm i have to find them first
<mark4> thats the avr assembler
<mark4> branch resolution is always either to a local label or a global label - my local label arrays allow for up to 10 local labels. when you do a forward reference branch to a local label it is not resolved until end-code
<mark4> i have arrays for local label definiaion which define the address of the branch opcode and a local label reference array
<mark4> you can have a max of 10 local labels in one word and a max of 10 forward references but you can forward reference to the same label more than once
<mark4> backwards references are resolved immediatly because we know the target address
<mark4> i do not allow forward references to global labels
<mark4> period
<mark4> and my asm> word is how I am able to allow mov dst, src instead of dst, src mov. i forget avr asm tho been too long :P
<mark4> oh. i do allow global locals so you can branch bacwards to a local label in the previos defeinition as long as it has not been overriden with the same local in the current definition
<john_cephalopoda> So local labels are word-wide?
<john_cephalopoda> How is a "word" defined in assembly?
<mark4> code foo <-- creates the header and points to HERE for its cfa... here is not yet populated
<mark4> locals CAN be global but L0: through L9: is all you have'
<mark4> if i have a few words in a row that all do the same last 3 opcodes for example i could set L0: or some other local on those opcodes and each of the following words can branch to that local even though that local is not local to them
<mark4> if global locals are off the local label definition table is wiped clean by the code word
<mark4> code foo <-- at this time all local label definitions are destroyed
<john_cephalopoda> Ah, I get it.
<mark4> can do things like chuck moore famous "dont do this" min max definitions... from memory i think i got this right
<mark4> : min 2dup < if begin nip ; : max 2dup > until then drop ;
<mark4> i have an equally small way of defining those : min 2dup < ?: drop nip ; : max 2dup > ?: nip drop ;
<remexre> yikes, how do those work
<mark4> ?: is a little invention of mine that repaces if do-true else do-false then with ?: do-true do-false
<remexre> er, I meant chuck's
<remexre> yours made sense by analogy to C :)
<mark4> yes
<mark4> the < if in min either falls through to NIP and throws away the one or the if branches to the then in the following definition and that drops the other item
<mark4> in max the until either falls through or it branches back to the begin
<remexre> hm... okay, yeah, I can see that
<remexre> ew
<mark4> yea its VERY tight code and very bad practice :)
<mark4> CM says "i wrote this, dont do this" lol
<mark4> his code is very optimum in both space and time
<mark4> so are mine
<mark4> in fact compiling both methods in my forth gives exactly the same number of bytes used
<mark4> dont use my asm> construct on any optmizing compiler that can inline definitons - it will be b0rked :P
<mark4> oh. to use my avr assembler you need a definitions file for the processor you are building for. i only ever created ONE and that was for the 32u4
<mark4> create a definition file like that one for ANY avr cpu and my assembler will asssemble code for it and wont allow you to use opcodes that uC does not support
<john_cephalopoda> I see a way to make traditional order work without tricks. A bit hacky but would work in a portable way.
<mark4> i like my return stack black magic there :P
<john_cephalopoda> Opcodes put something onto the stack, register followed by comma put something onto the stack, register without comma read the stack and build the assembly.
<mark4> what if you do something like mov [ xyzzy ], 0x1234
<mark4> that is perfectly valid in x86
<mark4> move memory, immediate
<john_cephalopoda> Right, it gets a bit difficult with immediates... Maybe force a ; after every line? ;þ
<mark4> lol
<mark4> or you could have each nemonic assemble the previous one which is what im doing with my return stack black magic. it could be done without that but i felt this way was ultra trivial to code
<mark4> and end-code would be how the final opcode was assembled
<mark4> the way i tell if there was an immediate specified is i take a snapshot of the stack pointer on entry into a nemonic and compare it with sp when im doing the assembly operation
<john_cephalopoda> I think the op-op-mnemonic way is the simplest and least magic way to do it.
<mark4> and it totally screws my brain up into a gordian knot
<mark4> lol
<mark4> i worked for vertex-rsi in longview texas who at that time used forth exclusively
<mark4> their asm code was backwards and to work on it i had to convert the entire file to readable asm, write my code in readable asm or forth then once i had it written in a way i could read i mangled it back the way they had it
<mark4> i spent months there and NEVER got used to backwards asm
<john_cephalopoda> It took me an hour to get used to backwards asm xD
<mark4> also mov ax, bx is mov bx into ax --- is that ax bx mov or bx ax mov?
<mark4> i could never figure that out and i doubt very seriously that that has ever been formalized
<mark4> it might be ziggy in one assembler and zaggy in another
<mark4> fsck that - give me straight intel syntax
<john_cephalopoda> AT&T syntax also has a point though. Practically all unix commands are "command source destination".
<john_cephalopoda> cp source.txt destination/
<mark4> at&t is an absolute ABOMINATION
<john_cephalopoda> While Intel does cp destination/ source.txt
<mark4> the ONLY reason for at&t is because unix was originally written for processors that had that operand order
<mark4> its FUCKING horrible and i hate it with an absolute passion
<john_cephalopoda> Very strong opinions :D
<mark4> if im trying to learn someething new and go to some web site that talks about unix asm and its at&t syntax i close the page and wont give it a single instant of my time
<mark4> yup
<mark4> at&t pisses me off :P
<john_cephalopoda> I don't care either way. I can juggle stuff around in my head.
<mark4> i mean... it could be the single greatest write up of some technique and... fuck at&t i wont give it one second of my time
<mark4> at&t exists because people were either incompetent or too damned lazy to do it right
<mark4> or both
<mark4> it would be like TOTALLY reinventing the order of operations in C simply because we wrote a new operating system that does thigns differently
<john_cephalopoda> Are you just against the operand order or also other aspects of AT&T syntax?
<mark4> so lets just create at&t c thats utterly CLUSTERFUCK compared to the norm
<mark4> EVERYTHING about at&t
<mark4> %rax <-- why do you need the % sign there cluster fucking up the text?
<mark4> %(j++; j=0; j<6) for <--- lets FUCK over the language as defined by its developers just because we want to be totally different
<mark4> and DUJMB
<mark4> or maybe that sould be (%j .. ;%j...; %j....)
<mark4> yea we need to put a % sign at the start of every variable name so we can tell its a variable
<remexre> make those $'s and you've got perl :)
<mark4> having extra text spalttered throughout your code makes the code less readable. thats one of the great ideas behind kotlin which is just a new syntax for java
<john_cephalopoda> remexre: https://www.famicol.in/sigbovik/
<mark4> expresses the same functionality in less characters..
<remexre> john_cephalopoda: seen that one, heh
<mark4> i dont even like having to do (char *)xyz_ptr to override types in C. it is just adding more visual cluster fuck to the sources
<john_cephalopoda> I like explicit casts.
<mark4> i keep having to fight the whoe if (... ) { 500 lines of code } else { 500 lines of code } or (test) ? xxx : yyy; <-- the latter is infinitly more readable to me for being more concise - in the former you have lost ALL context on the IF statment and that mkes it un readable
<mark4> the more you can express in LESS text the less visually cluttered your sorces will be
<mark4> java is famous for having over the top verbage just to do simple tasks
<mark4> kotlin reduces all that visual clutter significantly and in doing so significantly increases readability
<mark4> p.s. i am not a huge fan of java or kotlin its just an example of what im talking about
<john_cephalopoda> Hm, different topic: How was it to work with Forth as a job?
<mark4> awesome lol
<mark4> my first coding job was for joy mining machenery in england and they also used forth :)
<mark4> vertex-rsi was bought out by general dynamics c4 systems and... prior to that 100% of their products were done in forth... now zero percent are
<mark4> i dont even know if they are supporting any of their legacy products
<mark4> they do satellite tracking systems. they build the dishes, they do the tracking, they do the signal mux/demux and when i was there absolutely EVERYTHING on EVERY product was done in forth
<mark4> direct tv uses their products
<john_cephalopoda> That sounds pretty awesome.
<mark4> ya it was fun working there, i had two different contracts with them but i dont think they use forth at all anywhere now
<john_cephalopoda> I wanted to go into space&aerospace when I started my masters degree but ended up in embedded systems.
<john_cephalopoda> Now I got my first full-time job in industrial embedded systems. Everything coded in C.
<john_cephalopoda> It's fun, nice people at my workplace.
<mark4> where do you work?
<mark4> btw i dont have ANY degree in anything at all :)
<john_cephalopoda> South Germany, small company that does stuff in industrial communication and industrial hardware&software dev with a focus on functional safety.
<john_cephalopoda> I got a masters degree in CS.
<mark4> i would never have survived trying to geet a degree, i would have fought with everything they tried to teach me. thats bullshit, thats just wrong, i already know how to do this... ... . . lol
<john_cephalopoda> My favourite lectures were the ones about computational geometry. Really interesting algorithms that can be represented visually.
<mark4> :)
<mark4> thers one guy i could have studied under and he is german lol. he has published his letures on cryptograpnhy on youtube
<john_cephalopoda> Never did much with cryptography, even though I had a few lectures about it.
<john_cephalopoda> Too hard to get crypto right.
<mark4> his lectures are on how to do AES but he gives a LOT of background and information on legacy stuff like DES
<mark4> he also talks about the history of DES and AES
<mark4> very interesting lectures and in english which is good because i dont speak german :)
<john_cephalopoda> Hm, getting late here. Good night!
<mark4> night
john_cephalopoda has left #forth [""A tree works like your brain." ~ The Org Manual"]
dave0 has joined #forth
reepca has quit [Remote host closed the connection]