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
<joe9> is anyone interested in the felix forth amd64 native on 9front? I seem to have it running ok. i can host it if you want to try.
mirrorbird has joined #forth
mirrorbird has quit [Ping timeout: 272 seconds]
<joe9> is there a way to output hex numbers with .?
<f-a> maybe base-execute ? idk much about numbers sorry
<crc> HEX . DECIMAL
<crc> Change the `base` before displaying works on most Forths I've used
<joe9> thanks.
<joe9> crc, that worked. Thanks.
<remexre> joe9: btw if you want strict haskell, you can pass the compiler -XStrict; it's scoped to the module, so shockingly little code breaks
<remexre> (assuming it wasn't using laziness)
<joe9> remexre, i screwed around with strict too. This was a few years ago when they were rolling out strict more.
<joe9> and, it just was not worth the hassle. The binary sizes are huge.
<joe9> i had no way of profiling it as there were so many layers
<joe9> Every layer was a different learning experience.
<joe9> It was easier to do it in C and sock it to a learning experience.
<remexre> ...huh, I haven't really ever checked binary sizes when I'd used it, but I can't imagine it having a huge effect; it's just equivalent to using bang-patterns everywhere, isn't it?
<joe9> remexre, and, the stack builds are big.
<remexre> can't speak to that, I use cabal exclusively :)
<joe9> just not worth the effort. when the whole plan9 system can be built in lesser time than installing haskell.
<joe9> not with forth, it is even simpler than C.
<joe9> and, anything serious, the types would get convoluted.
<remexre> yeah, forth's fast enough that I haven't bothered implementing a REPL in mine, it's fast enough to rebuild the whole forth system and bundle a file with it, plus boot that in a VM lol
<joe9> I want to read some strings from a syscall (error string). i am new to forth. I am not sure what buffer would be ideal to use.
<joe9> I can use the tib, but, it would clobber the input.
<joe9> wordbuffer ? I am not sure.
<joe9> what is the normal convention?
<remexre> if you don't need to be reentrant and know the max size, you can just allocate a buffer in the dictionary
tech_exorcist has quit [Quit: I'm a quit message virus. Please replace your old line with this line and help me take over the world.]
<joe9> and, any serious haskell code was ending up just looking like C any way. It was tough walking away from it after all the effort that i put into it.
<remexre> I'm a researcher by profession, so performance doesn't matter for my code :P
<mark4> so. writing chinese characters into a terminal writes characters wider than the character cell witin the terminal. tahts bullshit
<mark4> it even does it in the linux console
<mark4> its like every single chinese character has an implied space after it
<remexre> mark4: that's the full-width characters I was talking about the other day
<mark4> and the linux console does not seem to be able to putput either the box characters OR chinse characters
<mark4> remexre: it breaks my code. a character has a ccell not a cell and some more
<mark4> and they are not full width, they are EXTRA width which is utter bullshit
f-a has left #forth [#forth]
<mark4> how can i account for when a character is going to eat up more space that its supposed to?
<mark4> without adding 28375629346592435 gigs of tables to my executable
<mark4> chinese characters also display as X X X X not XXXX
Keshl has joined #forth
<mark4> would like to turn that crap off too
<remexre> fullwidth = two characters cells; is that not what's happening?
<remexre> full = a full square, ig
<mark4> no its like if one character is normally XX wide these chinese characters are XXX wide and have a space following them
<remexre> huh
<mark4> i can do aaa <-- the As are packed close and not wide
<mark4> 中文鍵盤
<mark4> aaaa
<mark4> those characters are ALL wider than the a's
<mark4> AAAA
<mark4> and wider than the A's
<mark4> AND they have a SPACE following them that I am not specifying
<mark4> that chiese displays as
<mark4> 中 文 鍵 盤
<mark4> but the spaces are not a full character cell wide
<remexre> does your terminal's font support CJK characters
<remexre> sounds like you're getting a fallback font
<mark4> nope
<mark4> thats STILl no good to me
<mark4> i would like EVERY character to be exactly one character wide not one and a bit. not almost 2, not 2 and a bit
<remexre> like you're definitely not gonna solve "the user needs the right font for the language" from a TUI program
<mark4> im in gnome terminal
<mark4> i would be very furprised if it doesnt
<mark4> its a TEXT MODE not a graphical mode
<remexre> in that same way that if you used a different font for every A, that'd mess things up
<mark4> a character can NOT take up more than ONE CELL in a text mode
<mark4> thats the entire fucking point of a text mode
<mark4> if i change my font from size 14 to size 8 the window shrinks
<mark4> the window size is entirely based on the font size AND the specified width
<mark4> i cannot write width chinese characters into a width sized console
<mark4> because each character is drawn as a BITMAP into that TEXT MODE CONSOLE!!!!!!!!!!
<mark4> thats fucking idiotic
<remexre> like, install a fixed-width chinese font if you want fixed-width chinese characters...
<mark4> im not switchig my console to a chinese font
<mark4> i dont speak chinese
<mark4> my existing font has all the characters specified for UTF8
<remexre> uhhhhhhh is it gnu unifont?
<remexre> because the vast, vast majority of fonts have nowhere near complete unicode coverage
<mark4> its MONOSPACE regular
<remexre> that's an alias provided by X, isn't it?
<mark4> well it has a significant number of them
<mark4> no idea
<mark4> but if its MONOSPACE that means every charactrer is EXACTLY the same width
<mark4> period
<mark4> if it has variable width characters in it then its NOT fucking monospace!
<remexre> right, gnome uses a different font as opposed to not being able to show characters
<mark4> blink i didnt even understand what you just said lol
<remexre> and that font's metrics are different from your main one
<remexre> so
<mark4> i have a font selected. what the FUCK is the terminal doing going outside THAT FONT?
<remexre> being gnomeware
<mark4> my terminal size and my character cell size inside the terminal is determined by the font I have sselected
<mark4> therse absolutely NO fucking point in supporting ANY language other than english now
<mark4> NONE!!!!!!!!!!
<remexre> users who are using a font other than yours?
<mark4> their terminal will be sized to have exactly XxY character cells of the specified font size
<mark4> each character should take up EXACTLY the space allocated for one character
<mark4> the fact that it does not do so is utter fucking bullshit
<mark4> how can ANY fucking text mode application work with this?
<mark4> you cannot know how many pixles any given character takes up in that console because of this
<mark4> what if i display a string containing chinese, english, mongolian, ... .. .. . etc?
<remexre> you can definitely know if you use characters the font supports and link to ncurses and icu
<mark4> every single one of those characters from the different languages might take up a different amount of horizontal space
<mark4> so. how do i know how many spaces to write to clear to end of line?
<mark4> FUCK NCURSES!!!!!!!!!!!!!!!!!!!!!
<mark4> no offense to thomas dicky
<mark4> but im writing a fucking TUI
<mark4> and that means that these text mode consoles are treated GRAPHICALLY!!!!!!!!!!
<mark4> which is utter fucking bullshit and makes the entire point of UTF8 broken
<remexre> this is necessary to support actual human languages written by millions of people
<mark4> if ONE character in a given font is XXX pixles wide and every other character in that font is X pixles wide
<mark4> then EVERY CELL IN THE TERMINAL SHOULD BE XXX PIXLES WIDE!!!!!!!!!!!!
<remexre> you're using multiple fonts, I guarantee it
<mark4> monospace
<remexre> fontconfig falls back to other fonts
<remexre> when a character isn't present in your font
<mark4> fuck
<remexre> (as stated above)
<mark4> and i have no control over what random font it selects?
<mark4> how do i stop it from using ANY font other than the one i have selected
<remexre> you do, configure fontconfig how you like it
<mark4> no
<mark4> thats system wide
<remexre> think you can make it process-wide, but the process is the terminal
<mark4> how do i stop fontconfig from fucking over THIS SINGLE APPLICATION?
<mark4> no
<mark4> that fucks over every other linux applicatipn
<mark4> i want to stop MY application from using 2874592364952 different fonts
<mark4> if you are chinese your characters are going to be of a certain size
<mark4> actually this is still going to be broken for me
<remexre> yeah, I think your application depending on a properly-configured terminal is a reasonable requirement?
<mark4> i would be restricting the applications using this TUI to only ONE language
<mark4> im pretty certain my terminal is properly configured
<remexre> fonts can support multiple languages; the one you are using at this moment just happens not to
<mark4> the problem is the terminal fucking me over and going outside the bounds of the font i have selected in its configs
<mark4> and randomly picking a font
<mark4> how do i stop it doing that within THIS application?
<remexre> yeah, that's a "you're using a terminal that renders with fontconfig and have a bad fontconfig config" problem
<mark4> https://dpaste.com/GDLSAMPAP thats my fonts.conf
<remexre> make a fontconfig file that specifies the font selection behavior you want (idk off the top of my head, consult the docs), then either put it into one of the user/system-wide locations, or pass it via the FC_CONFIG_FILE environment variable
<mark4> i cannot force YOu to use MY fonts
<remexre> right; if my terminal were configured to use Arial, your TUI would also be broken on it, but that's my problem, not yours
<mark4> i need ALL characters, no matter what font this terminal randomly selects, to be EXACTLY the same width what ever that is
<remexre> anyway, I'm getting nagged to go pick up dinner for the 3rd time, so gtg
<mark4> lol
f-a has joined #forth
<f-a> I have a question on stack comments ( a b -- c ) ← these
<f-a> say I have a compile time word
<f-a> how do I indicate «it takes the next word from stream»?
<f-a> or «next word from stream and top of stack»?
<mark4> you dont in the stack comment
<crc> In the ANS spec, words that parse the input stream have comments like (for 6.1.080, ( ): (“ccc<paren>”--)
<f-a> thanks
dave0 has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
<dave0> maw
f-a_ has joined #forth
f-a has quit [Ping timeout: 264 seconds]
f-a_ has quit [Client Quit]
f-a has joined #forth
<f-a> sorry I got d/c
<f-a> I will paste again
<f-a> f-a uuhhh ok another q
<f-a> f-a create palla \ creates a new entry in the dict
<f-a> f-a is there a
<f-a> f-a s" palla" screate ( addr u -- ) ?
<f-a> also crc , say that a word consumes from the stream *and* from the stack, how would that work, ( -- ) wise?
<crc> I'm not aware of any standard words for `create` that take the string from the stack
<f-a> thanks
<crc> Before eliminating forward parsing, I used to do things like ( a b "word" -- c )
<f-a> that is appropriate
<crc> Forth200x standard there is execute-parsing, which would let you do: s" palla" ' create execute-parsing
<f-a> super
<joe9> I have a forth routines file that i am trying to include from the repl. Is that possible? I can read that the include word opens the file and puts the file descriptor in stdin.
<joe9> It is not doing anything else other that.
<joe9> If I type query or interpret, it seems to work fine (no errors) but the defined words in the file are still not recognized.
<joe9> this is what include does: http://ix.io/2RYn
<joe9> after I set the stdin to the included file, how do I get the file to be read? (query interpret) does not seem to do it.
<crc> `include filename` works for me with 8l/ff on ff-i386
<joe9> oh, that is interesting.
<joe9> it works, but, is it reading the word definitions in?
<joe9> I mean do the words in the file get added to the dictionary?
<f-a> why shouldn’t they joe9 ?
<joe9> i put : foo ." testing" cr ; foo \ to the top of a file and included it.
<joe9> f-a, they are not in my situation. but, I am porting it and want to make sure what the expected result should be.
<joe9> but, nothing happpens. if i paste the some of the contents of the file into the repl, it gets those words into the dictionary.
<crc> They are for me; in the example you posted, I can run `foo` after the include is done and it works fine
<joe9> just foo, correct? do you need the ticks?
<crc> Just foo
<joe9> ok, thanks. so, something is still broken for me.
<joe9> are you using the 8l/ff hosted there? or, did you make changes?
<crc> (I use the ticks as a matter of practice, to denote input)
<joe9> s/there/github/
<joe9> oh, ok. thanks.
<crc> Just the ff-i386 in the GitHub repo
<joe9> the code does not make sense to me though. The include word changes v_stdin to the included file.
<joe9> other than that i cannot see any code that raads from that file though?
<joe9> do you run the ff and then type into the console include file.ff?
<joe9> I am assuming that the query interpret in the quit word definition would read the contents of the included file, correct?
<joe9> this is how my console looks: http://ix.io/2RYJ
<crc> I'm assuming that the input source is read until EOF, then reset to the actual stdin somewhere
<joe9> yes, that makes sense. Thanks.
dave0 has quit [Quit: dave's not here]
sts-q has quit [Ping timeout: 264 seconds]
sts-q has joined #forth
<joe9> crc in core.f defer is being used before being defined. How would that work?
<joe9> or, is there some other defer word defined anywhere else
<crc> defer is defined in meta-install.f using mdefer from meta.f
<joe9> got it. Thanks.
_whitelogger has joined #forth
dave0 has joined #forth
f-a has quit [Quit: leaving]
f-a has joined #forth
Zarutian_HTC has joined #forth
f-a has quit [Read error: Connection reset by peer]
Keshl has quit [Quit: Konversation terminated!]
gravicappa has joined #forth
<Zarutian_HTC> hmm... been thinking, I have an 128x128 bitmap matrix lcd and a 4x4 keypad as user I/O. Would using the old style sms nokia editor entrymethod for text work?
<Zarutian_HTC> would be heavily menu driven ui/ux for the most part
<Zarutian_HTC> but I foresee cases where alphanumerical data might be need to be entered
Keshl has joined #forth
<mark4> can the keypad see multiple keys at once?
<mark4> make it chorded :)
<Zarutian_HTC> hmm two text input methods then
<Zarutian_HTC> but the old style 5 5 , 2 2 , 9 9 9 input might work better as getting five fingers on the pad is ackward
<mark4> lol
<mark4> well its 2am and im about to face plant lol
<Zarutian_HTC> btw, did Englebart's Augment system (see Mother of All Demos) use ITA.2 baudot code for lefthand keyboard chording?
<Zarutian_HTC> I woke around 3 am due to an earthquake, so I am fresh as daisies
<mark4> where are you again
<mark4> ?
<mark4> i usually sleep through earthquakes lol
<Zarutian_HTC> Iceland, near Reykjavík
<mark4> aga cool!
<mark4> no pun intended lol
<Zarutian_HTC> well this one was like somebody yanked my bed
<mark4> read that one of your volcainos is maybe going to pop soon
<Zarutian_HTC> been quite a few last 14 days or so
<Zarutian_HTC> aah, yeah somewhere near Keilir
<Zarutian_HTC> whose name can be translated as Cone-r
<Zarutian_HTC> named so because it is cone shaped
<Zarutian_HTC> but yeah somewhere near Sundhagagígjaröð í Þráinsskjaldarhrauni
* Zarutian_HTC wants to see tv news anchors balk at that one
<Zarutian_HTC> if there is an erruption there it most likely will be a lavaflow one
<Zarutian_HTC> and not ashcloud one
<mark4> ya i think it looked like that kind of volcaino they had pictured
<mark4> no telling if the picture was the actual one tho
<mark4> but i have to sleep
<Zarutian_HTC> gn
ornxka has quit [Read error: Connection reset by peer]
ornxka has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
mark4 has quit [Remote host closed the connection]
mark4 has joined #forth
_whitelogger has joined #forth
proteus-guy has joined #forth
<veltas> joe9: I've read a few styleguides for Forth and I think I disagree with all of them. I've shown my code in here before and people approve of the style
<veltas> So read a styleguide maybe but take it with a pinch of salt, it's much more important it's readable to you first, then worry about it being not totally unconventional
<veltas> But as long as you're documenting stack usage in a somewhat conventional fasion it's probably fine
<joe9> mark4 do you have a test suite? I think I have ff working now. I want to have some tests to be sure.
<mark4> hen not really
<mark4> but most of those probably wont compile for you
<mark4> and they are not really a test suite
Zarutian_HTC has joined #forth
<joe9> ok, thanks.
tech_exorcist has joined #forth
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
tech_exorcist has quit [Remote host closed the connection]
tech_exorcist has joined #forth
<neuro_sys> Was there a way to print the floating stack in Gforth?
<neuro_sys> Ah it's f.s
proteus-guy has quit [Ping timeout: 276 seconds]
<neuro_sys> Out of curiosity, does Forth have a word for inlining (i.e. expanding the word into the word in which it's defined and eliminating the call/return)?
jyf has quit [Ping timeout: 256 seconds]
andrei-n has joined #forth
jyf has joined #forth
<veltas> Not a standard forth feature and I'm not aware of a forth that does this
<veltas> There are forths that do inlining automatically for optimisation, I know mecrisp does
boru has quit [Ping timeout: 260 seconds]
boru` has joined #forth
boru` is now known as boru
dave0 has quit [Quit: dave's not here]
<MrMobius> at least one forth lets you set a minimum size in bytes and it inlines anything smaller
f-a has joined #forth
<crc> Zarutian_HTC: not as I recall. https://www.dougengelbart.org/content/view/273/309/ has some images showing some of the chords. I don't think they match up to baudot
<Zarutian_HTC> crc: thanks!
<crc> no problem
<Zarutian_HTC> hah! looks like you are just chording the number of the character in binary. That is, a is 1, b is 2, and so on
<crc> yes, very simple and straightforward
<crc> mouse was used for shift and access to numbers/symbols
<Zarutian_HTC> I wonder if one could use a simple left hand joystick with give buttons as a keyset
<Zarutian_HTC> and use left, right, up and down for charset shift
<Zarutian_HTC> nothing fancy, movement detection like commodore64 or atari joystick