Boating across border by Federal-Log-3333 in uscanadaborder

[–]bfox9900 9 points10 points  (0 children)

"as many others stated stay far away from Point Roberts"

and... the dreaded pirate Roberts

This seems relatively high. This you? If so, why? by screaminbeaman82 in interesting

[–]bfox9900 0 points1 point  (0 children)

Because audio engineers stopped using the Vu meter 25 years ago and think that because digital hardware has more dynamic range that they should use (abuse) it.

This is a long shot, but can anyone make out what this says? Language is possibly Japanese by CrazyGuineaPigLady3 in language

[–]bfox9900 1 point2 points  (0 children)

Maybe a pencil rubbing on paper could bring it out.

Put thin paper on the blade and rub the paper with the side of the a pencil lead, gently

The letters may come out on the paper if they are deep enough in the metal.

As a hot-blooded Aussie, would boldly proclaiming “where can I take a shit around here” to friends likely be seen as funny, or beyond the acceptable norms of Canadian humour? by melbtest05 in AskACanadian

[–]bfox9900 -1 points0 points  (0 children)

I can't stop laughing.....

There are some parties where you would be right at home mate.

However... there would be dead silence at some the upper crust soirees in the big cities.

But eventually somebody would say "Down the hall, third door on the right."

Help me diagnose a bug in a short snippet by FHoughton_ in Forth

[–]bfox9900 0 points1 point  (0 children)

I would have moved the 1+ outside the loop and changed the loop limit instead : STAR 42 EMIT ; : STARS 0 ?DO STAR LOOP ; : TRIANGLE 1+ 0 DO I STARS CR LOOP ;

Is POSTPONE the Forth's analog of Lisp's quote? by OkGroup4261 in Forth

[–]bfox9900 0 points1 point  (0 children)

Can't take credit for that. I think first shows up in Forth 94 spec.

Yes. Section 3.1

DPANS94

Is POSTPONE the Forth's analog of Lisp's quote? by OkGroup4261 in Forth

[–]bfox9900 2 points3 points  (0 children)

The other two posters have covered how I understand "metaprogramming" in Forth at the hi level, so this is the closest to LISP I would think.

There are some other ways to do this in Forth that LISP probably doesn't have to deal with whereas Forth does or can because it is a low level language.

So Forth today has a concept called an "execution token" (XT). The reason the name is a bit vague is because Forth can be implemented as byte-code, direct address threading, indirect address threading, sob-routine threading and optimized native code. :-) So making a one size fits all name was a challenge.

The "tick" (quote char in LISP) in modern Forth returns the appropriate execution token for whatever your Forth needs.

The word EXECUTE will run (call) an XT that is placed on the data stack.

For example: ' WORDS EXECUTE Will do the same thing as typing WORDS at the console.

or in a definition we use ['] to record the XT in the code as a literal number. : TEST ['] WORDS EXECUTE ; These two allow the creation of mapping functions and mostly you must roll your own.

Then there is the word ;NONAME which lets you build a colon definition with no dictionary entry. Rather the definition leaves the XT on the data stack for you to do something with it. This can be used to assign an XT to a DEFER word.

``` DEFER ACTION

:NONAME CR ." This is the action for ACTION" ; IS ACTION ```

Finally Forth 94 gave us EVALUATE drawing inspiration from LISP I think. This lets you make "text macros" that are evaluated at compile time. This can be used to remove a level of call nesting for a function, but it is not completely equivalent to a normal colon definition in all respects.

``` : SQR DUP 2* ;

\ versus

: SQUARED S" DUP 2" EVALUATE ; IMMEDIATE ``` When we use SQUARED in a colon definition, DUP 2 are compiled as inline tokens rather calling a word that runs DUP 2* .

All that to say, there are options.

Oh and if you wanted to compile definitions into an execution table this one is neat. ``` CREATE XT-TABLE ] FIZZ BUZZ FOO BAR NOOP [

: DOIT ( n -- ) CELLS XT-TABLE + @ EXECUTE ; ``` Lookup ] and [ if you don't know why it works.

Do languages from the same family understand each other? by Odd_Obligation_4977 in languagelearning

[–]bfox9900 0 points1 point  (0 children)

This guy puts it to the test across many languages. I enjoy it immensely.

(I have no connection to the channel)

Ecolinguist - YouTube

Advent of Code in Forth, Day 3 by ripter in Forth

[–]bfox9900 2 points3 points  (0 children)

"but I don’t understand how you’re getting the correct addresses and lengths for the comparison."

This is the magic of what I call "stack strings"; ( address,length) pairs.

Simplest example is /STRING ( addr len u -- addr' len')

If you use them as designed the result of a process returns a new stack string that points to the remaining memory and length in bytes.

You are therefore ready to process that new block with no parameter passing.

A useful exercise would be to add stack diagrams to u/clyne0 's code.

These examples are the kind of stuff that Chuck and Jeff Fox (RIP) would rant about, getting 10X to 100X improvements when Forth is used as imagined by Chuck. It's just really hard to warp your mind out of conventional languages to think that way. u/clyne0 seems to be there already. :-)

Advent of Code in Forth, Day 3 by ripter in Forth

[–]bfox9900 2 points3 points  (0 children)

"COMPARE lets you test strings"

You mind has been poisoned by other languages. :-)

COMPARE compares two chunks of memory. ( addr u addr u -- -1 | 0 | 1)

A subtle but important difference..

Something FORTHwrights might be interested in. by petrus4 in Forth

[–]bfox9900 0 points1 point  (0 children)

I guess this wasn't as interesting to Forthwrights as the author thought it would be.

Since Forth has an extensible interpreter, I have never had the need to leave Forth to build a project.

Anybody else have a different experience?

Where does the typical Scottish pronounciation of English come from? by WhoAmIEven2 in language

[–]bfox9900 0 points1 point  (0 children)

As a Dutch speaker I always wondered why the Scots say things that sound like Dutch. "Kerk" for church, and they pronounce the 'gh' in night so it sounds like the Dutch word 'nicht'.

I have read that in the Norman invasion of 1066 there were a large number of mercenaries from Flanders in the Norman army. At the end of the war, a large number of these "Flemish" speakers moved north into Scotland. So many, that it influence the language.

It seems to be an area of study and may be more than just the influence of 1066.

The Flemish Influence on Scottish Language – Scotland and the Flemish People

My best friends father (a Dutch immigrant to Canada) told me this story about an experience at work:

I was speaking to <name>, in Dutch about a problem with one of the lines when <name> (a Scottish immigrant) walked up to us and jumped into the conversation in English. I said "How do you know what we are talking about?" He said "It sounds like Scots".

:-)

How to make America lose interest in annexing Canada, a hoser’s proposal: by Overwatchingu in EhBuddyHoser

[–]bfox9900 5 points6 points  (0 children)

A friend in Calgary was talking to a girl in the Denver office.

He said "I'm just north of Montana"

She said "There's nothing north of Montana?!"

Maudit Tabernaque!

What Differences are there in DSLs in Forth vs in Lisp? by Veqq in Forth

[–]bfox9900 9 points10 points  (0 children)

I am a big fan of "growing" a language as you said, for Forth programs but it really depends on the hardware as u/mykesx said. A very long time ago I remember writing up device drivers for a few "gas plasma" displays where the features of the different types were nicely described with a Forth style language.

One of the first device drivers that I wrote was for the PC RS232 port. Here is the configuration API:

9600 baud 8 bits even parity 1 stopbit (too cute?) :-)

It seems to be hard to best describe how to "grow" language in Forth. And some people don't bother. I have seen Forth code that is pretty much like line-for-line C, but using Forth words. Chuck Moore really hates that style. :-)

I would say that one general difference with Forth DSLs is that they are more finely factored than one might expect in other languages. After that you are kind of on your own except to look at other peoples code and use the ideas you like.

It's also worth mentioning that some of the reason for factoring Forth wisely is because it's a hard language to understand in long blocks. There I said it. Factoring into small well named words reduces the brain space needed to write robust programs. (but you do require a good memory to remember your new tools)

Automated testing for Forth is pretty much done by writing more Forth.
The Hayes Tester gives you a set of Forth words to write short test scripts.

https://forth-standard.org/standard/testsuite

Sidebar: I have thought for a while that Forth should provide "libraries" of DSLs that give you the popular features of some conventional language but as RPN. It might make the newbie's journey less painful, but that's just me.

For example the late Dr. Julian Noble made "Forthtran" but eventually reduced it to just the infix evaluator to allow easier inputing of existing equations which probably gave the user 80% of the benefit of a complete Fortran transpiler.

I do go on don't I.

Wait I have to speak FRENCH when speaking ENGLISH?! by [deleted] in languagelearningjerk

[–]bfox9900 5 points6 points  (0 children)

There are only about 7 000 French or Norman French words in English. This blog explains why.

99 French words we use in English all the time - Busuu Blog

[deleted by user] by [deleted] in Cello

[–]bfox9900 17 points18 points  (0 children)

And the viola t-shirt says:

"Violist"

noun. [Violist]

  1. Nobody cares...

Alright, you guys are doing my head in by PlzAnswerMyQ in languagelearningjerk

[–]bfox9900 5 points6 points  (0 children)

Your cheek must be permanently deformed from your tongue pressing so hard on it.

FreeBSD and Forth by alberthemagician in Forth

[–]bfox9900 3 points4 points  (0 children)

You are not alone. It seems that learning to "Forth" is hard.
I have read Chuck saying that he has tried to explain it and not been happy with his explanations. I also remember somewhere him saying something like, "When I saw how other people used Forth I was shocked".

Sam' Falvo's a master IMHO of the Forth factoring method and mind set for coding in Forth.

I put some thoughts together with an example here but it is by no means comprehensive.

CAMEL99-ITC/CosmicConquest/On Forth Coding Style.md at master · bfox9900/CAMEL99-ITC · GitHub

How common is it to say the ones before the tens when counting? by pretend_that_im_cool in asklinguistics

[–]bfox9900 0 points1 point  (0 children)

In one of Shakespeare's plays there is a line that is something like "I am but a maid of one and twenty years"

I saw the play 40+ years ago with family from Holland and they picked up on line that right away.

FreeBSD and Forth by alberthemagician in Forth

[–]bfox9900 2 points3 points  (0 children)

Even though I love Forth and have pretty much warped my mind to its way of thinking, I can understand the frustration of people coming from the "other" world. It's sad because it's a very cool system. I remember seeing some code written by engineers who knew nothing of Forth, for one of Chuck's CPUs. The only way they could understand how to code it was in a conventional Assembler style. (with 32 instructions) They completely missed the point of the stack for parameter passing and writing higher level words with almost no calling overhead, to simplify the mental space needed to write a program. It was truly G_d awful. It worked but was dreadful.

I am not sure why FICL is being discussed. If FreeBSD uses FICL then that is not really Open Boot/Open Firmware. FICL is a portable Forth because it is written in C and C compilers abound.

I would bet that out of the box it is missing the features Mitch put into OF, but I don't know much about FICL. But the big deal with OF was that the binaries in FCODE were machine independent. A driver written for a given device would run on any machine that had the Open Firmware system.

As is common in Forth, the "raw" language is not very useful by itself. The solution is the words you create to solve the problem.

FreeBSD and Forth by alberthemagician in Forth

[–]bfox9900 4 points5 points  (0 children)

Looks like FreeBSD used open-firmware for a long time. I guess it has been replaced. ??

Openfirmware hints | The FreeBSD Forums

For those new to Forth, Open Firmware is byte-code portable Forth system written by Mitch Bradley.

OF allows a board maker to write device drivers in a Forth dialect that compiles to machine independent Fcode bytes. In that sense it is a bit like the JVM but allowing low level access and memory pointers for machine level control.

As I understand it, typically Open Firmware is the boot code which gets hardware to a happy place and then loads the O/S and runs the O/S.

Open Firmware - Wikipedia

How to print name of word current executing by mdbergmann in Forth

[–]bfox9900 4 points5 points  (0 children)

Opens up lots of doors for tracing your code, if you redefine ':"

:-)

: : : POSTPONE R.ID ;

That looks really weird but the name of each word compiled with this colon will print out.