Not really I'm afraid. Effects can be anywhere and they are not wrapped at all.
In technical terms it's stack-oriented meaning the only way for functions (called "words") to interact with each other is via a parameter stack.
Here's an example:
: TIMES-10 ( x -- y )
10
*
;
12
TIMES-10
.S
120
TIMES-10 is a word which pops one parameter from stack and pushes the result of its calculation onto stack. The ( x -- y) is a comment which conventionally documents the "stack effect" of the word.
Now when you type 12 and press RETURN, the integer 12 is pushed onto stack. Then TIMES-10 is called which in turn pushes 10 onto stack and invokes * which pops two values from stack and multiplies them and pushes the result onto stack.
That's why when type .S to see the contents of the stack, you get 120 in response.
Another example is
5 10 20 - *
.S
50
This simple example demonstrates the reverse Polish notation (RPN) Forth uses. The arithmetic expression is equal to 5 * (20 - 10) the result of which is pushed onto stack.
PS: One of the strengths of Forth is the ability to build a vocabulary (of words) around a particular problem in bottom-to-top fashion, much like Lisp.PPS: If you're ever interested to learn Forth, Starting Forth is a fantastic resource.
Besides the fun of stretching your mental muscles to think in a different paradigm, Forth is usually used in the embedded devices domain (like that of the earlier Mars rover I forgot the name of).
This project for me is mostly for the excitement and joy I get out of implementing a Forth (which is usually done in Assembler and C) on the JVM. While I managed to keep the semantics the same the underlying machinery is vastly different from, say, GForth. I find this quite a pleasing exercise.
Last but not least, if you like concatenative but were unable to practice fun on the JVM, bjForth may be what you're looking for.
That's impossible unless you've got a Forth machine.
Where the OS native API is accessible via C API, you're bound to write, using C/C++/Rust/etc, a small bootstrap programme to then write your Forth on top of. That's essentially what bjForth is at the moment: the bootstrap using JVM native API.
Currently I'm working on a set of libraries to augment the 80-something words bjForth bootstrap provides. These libraries will be, as you suggested, written in Forth not Java because they can tap into the power of JVM via the abstraction API that bootstrap primitives provide.
Haha...good point!
That said bjForth is still a fully indirect threaded Forth. It's just that instead of assembler and C/C++ it calls Java API to do its job.
IMO a good way to help a FOSS maintainer is to actually use the software (esp pre-release) and report bugs instead of working around them. Besides helping the project quality, I'd find it very heart-warming to receive feedback from users; it means people out there are actually not only using the software but care enough for it to take their time, report bugs and test patches.
Can you provide what you mean by check the environment, and why you’d need to do that before anything else?
One recent example is a makefile (in a subproject), w/ a dozen of targets to provision machines and run Ansible playbooks. Almost all the targets need at least a few variables to be set. Additionally, I needed any fresh invocation to clean the "build" directory before starting the work.
At first, I tried capturing those variables w/ a bunch of ifeqs, shells and defines. However, I wasn't satisfied w/ the results for a couple of reasons:
Subjectively speaking, it didn't turn out as nice and easy-to-read as I wanted it to.
I had to replicate my (admittedly simple) clean target as a shell command at the top of the file.
Then I tried capturing that in a target using bmakelib.error-if-blank and bmakelib.default-if-blank as below.
That's why I thought there may be a better way of doing this which led me to the manual and then the method I describe in the post.
running specific targets or rules unconditionally can lead to trouble later as your Makefile grows up
That is true! My concern is that when the number of targets which don't need that initialisation grows I may have to rethink my approach.
I'll keep this thread posted of how this pans out as the makefile scales.
Even though I’ve been writing GNU Makefiles for decades, I still am learning new stuff constantly, so if someone has better, different ways, I’m certainly up for studying them.
Love the attitude! I'm on the same boat. I could have just kept doing what I already knew but I thought a bit of manual reading is going to be well worth it.
Not really I'm afraid. Effects can be anywhere and they are not wrapped at all.
In technical terms it's stack-oriented meaning the only way for functions (called "words") to interact with each other is via a parameter stack.
Here's an example:
TIMES-10is a word which pops one parameter from stack and pushes the result of its calculation onto stack. The( x -- y)is a comment which conventionally documents the "stack effect" of the word.Now when you type
12and press RETURN, the integer 12 is pushed onto stack. ThenTIMES-10is called which in turn pushes10onto stack and invokes*which pops two values from stack and multiplies them and pushes the result onto stack.That's why when type
.Sto see the contents of the stack, you get120in response.Another example is
This simple example demonstrates the reverse Polish notation (RPN) Forth uses. The arithmetic expression is equal to
5 * (20 - 10)the result of which is pushed onto stack.PS: One of the strengths of Forth is the ability to build a vocabulary (of words) around a particular problem in bottom-to-top fashion, much like Lisp. PPS: If you're ever interested to learn Forth, Starting Forth is a fantastic resource.
Besides the fun of stretching your mental muscles to think in a different paradigm, Forth is usually used in the embedded devices domain (like that of the earlier Mars rover I forgot the name of).
This project for me is mostly for the excitement and joy I get out of implementing a Forth (which is usually done in Assembler and C) on the JVM. While I managed to keep the semantics the same the underlying machinery is vastly different from, say, GForth. I find this quite a pleasing exercise.
Last but not least, if you like concatenative but were unable to practice fun on the JVM, bjForth may be what you're looking for.
Hope this answers your question.
Whoa! This is pretty rad! Thanks for sharing!
That's definitely an interesting idea. Thanks for sharing.
Though it means that someone down the line must have written a bootstrap programme with C/Assembler to run the host forth.
In case of jbForth, I decided to write the bootstrap too.
That's impossible unless you've got a Forth machine.
Where the OS native API is accessible via C API, you're bound to write, using C/C++/Rust/etc, a small bootstrap programme to then write your Forth on top of. That's essentially what bjForth is at the moment: the bootstrap using JVM native API.
Currently I'm working on a set of libraries to augment the 80-something words bjForth bootstrap provides. These libraries will be, as you suggested, written in Forth not Java because they can tap into the power of JVM via the abstraction API that bootstrap primitives provide.
Hope this makes sense.
Haha...good point! That said bjForth is still a fully indirect threaded Forth. It's just that instead of assembler and C/C++ it calls Java API to do its job.
Thanks for the pointer! Very interesting. I actually may end up doing a prototype and see how far I can get.
Thanks. Bookmarked the site. Also noted RE age.
Thanks. I'd go the online route if my kid was a few years older but given the age, I believe in-person lessons are the best for now.
Thanks. Bookmarked.
UPDATE: lemmy.ml is now on lemmy-meter 🥳
Good question!
IMO a good way to help a FOSS maintainer is to actually use the software (esp pre-release) and report bugs instead of working around them. Besides helping the project quality, I'd find it very heart-warming to receive feedback from users; it means people out there are actually not only using the software but care enough for it to take their time, report bugs and test patches.
"Announcment"
It used to be quite common on mailing lists to categorise/tag threads by using subject prefixes such as "ANN", "HELP", "BUG" and "RESOLVED".
It's just an old habit but I feel my messages/posts lack some clarity if I don't do it 😅
What's
/ssupposed to do in this context? 🤔 It looks like a Windoze/.NET command line option.One recent example is a makefile (in a subproject), w/ a dozen of targets to provision machines and run Ansible playbooks. Almost all the targets need at least a few variables to be set. Additionally, I needed any fresh invocation to clean the "build" directory before starting the work.
At first, I tried capturing those variables w/ a bunch of
ifeqs,shells anddefines. However, I wasn't satisfied w/ the results for a couple of reasons:cleantarget as a shell command at the top of the file.Then I tried capturing that in a target using
bmakelib.error-if-blankandbmakelib.default-if-blankas below.But this was not DRY as I had to repeat myself.
That's why I thought there may be a better way of doing this which led me to the manual and then the method I describe in the post.
That is true! My concern is that when the number of targets which don't need that initialisation grows I may have to rethink my approach.
I'll keep this thread posted of how this pans out as the makefile scales.
Love the attitude! I'm on the same boat. I could have just kept doing what I already knew but I thought a bit of manual reading is going to be well worth it.
That's a great starting point - and a good read anyways!
Thanks 🙏
Agree w/ you re trust.
Thanks. At least I've got a few clues to look for when auditing such code.
Oh, neat!
On another note: ~2 mins looks like rather a "long" window of maintenance/disruption for what Cloudflare is 🙈
I'm not an 1.e4 or Sicilian player but this smells like wild tactical variations early in the game.