Every time I try forth, I start some interpreter, type some words, then it works and I feel like I want to learn more and want to write some code to actually try it out. But every time I hit a wall.process that I can imagine working, but it is crude, and prone to numerous mistakes:
For example yesterday I installed SwiftForth, I read the documentation and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it. This is the
1. Open interpreter, write some code, test it until it workst remember anymore what they were.
2. Hope that SwiftForth doesn't crash and you don't loose all your progress 3. Scroll up through the history or list the words, and hope I copy paste stuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire, manually type INCLUDE my-updated-file
SwiftForth doesn't seem to have a command line arguments help in the documentation PDF, nor there seem to be a way to reset the state of a interpreter. At least I couldn't find any. I had similar issues with other interpreters some time back, but I can'
I'm probably missing something obvious, or there's something I don't get.
Hope that helpsWell that makes way more sense. I'll just get it on WSL in windows. That's how I imagine any modern ish language work (within a context of modern OS and disks).
For example yesterday I installed SwiftForth, I read the documentation and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it. This is theprocess that I can imagine working, but it is crude, and prone to numerous mistakes:
1. Open interpreter, write some code, test it until it works
2. Hope that SwiftForth doesn't crash and you don't loose all your progress 3. Scroll up through the history or list the words, and hope I copy paste stuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire, manually type INCLUDE my-updated-file
Every time I try forth, I start some interpreter, type some words, then it works and I feel like I want to learn more and want to write some code to actually try it out. But every time I hit a wall.process that I can imagine working, but it is crude, and prone to numerous mistakes:
For example yesterday I installed SwiftForth, I read the documentation and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it. This is the
1. Open interpreter, write some code, test it until it works
2. Hope that SwiftForth doesn't crash and you don't loose all your progress 3. Scroll up through the history or list the words, and hope I copy paste stuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire, manually type INCLUDE my-updated-file
4. Copy and paste words from the text editor into the SwiftForth window
5. Test the words in SwiftForth
You will get warnings that words are redefined because your new words override the old ones. If you don't want these warnings, type EMPTY
before pasting. This will delete all your previous definitions in SwiftForth.
I always write code in the text editor, include the file in SwiftForth, and test
everything. If something goes wrong, I revise the file, type EMPTY, and include
the revised file.
Well that makes way more sense. I'll just get it on WSL in windows. That's how I imagine any modern ish language work (within a context of modern OS and disks)....
On Tuesday, March 14, 2023 at 10:52:27 AM UTC-6, NN wrote:
Hope that helpsWell that makes way more sense. I'll just get it on WSL in windows. That's how I imagine any modern ish language work (within a context of modern OS and disks).
To those who knows, is SwiftForth somewhat weird or is it just evaluation version?
Is there a common word/process used to reset forth environment?
Reason why I want to learn forth, is I'm in the process of designing esoteric homebrew computer for fun, and I think forth would be the best fit to run as a monitor+built-in language. But I want to actually learn it properly-ish first.
I'm in the process of designing esoteric homebrew computer for funMe too! I think you're exactly right, Forth is perfect for this. Using block files, a microcontroller with eeprom would be a complete system using block files (the way Forth interacted with disk long ago.) gForth supports block files, but the editor is
Well, obviously - you haven't tried 4tH.
I'm sure there's a way to configure Code to do this for you, but it hasn't been a painful enough problem for me to deal with yet.
Me too! I think you're exactly right, Forth is perfect for this. Using block files, a microcontroller with eeprom would be a complete system using block files (the way Forth interacted with disk long ago.) gForth supports block files, but the editor isabsolutely minimal. Learn Forth first, then look into block files. I have gone about it the other way and I don't recommend it.
On Tuesday, March 14, 2023 at 5:54:49 PM UTC-6, Van Kichline wrote:
I'm sure there's a way to configure Code to do this for you, but it hasn't been a painful enough problem for me to deal with yet.It's actually quite simple. .vscode/tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "bash",
"args": [
"-c",
"\"gforth main.f\""
]
}
]
}
Every time I try forth, I start some interpreter, type some words, then it works and I feel like I want to learn more and want to write some code to actually try it out. But every time I hit a wall.
I'm probably missing something obvious, or there's something I don't get.
For example yesterday I installed SwiftForth, I read the documentation and = >it has few pages on source management. The only word that seem to matter to=
me in this case is INCLUDE. But it doesn't seem to go deep into how to act=
ually use it. This is the process that I can imagine working, but it is cru= >de, and prone to numerous mistakes:
1. Open interpreter, write some code, test it until it works
2. Hope that SwiftForth doesn't crash and you don't loose all your progress >3. Scroll up through the history or list the words, and hope I copy paste s= >tuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire,=
manually type INCLUDE my-updated-file
SwiftForth doesn't seem to have a command line arguments help in the docume= >ntation PDF
nor there seem to be a way to reset the state of a interpreter=
.
Yaroslav Veremenko <werewolfprankster@gmail.com> writes:<SNIP>
nor there seem to be a way to reset the state of a interpreter=
.
Maybe COLD. Or you could set a marker at the start of the program and
then run it when you want to reset it:
marker reset include program.4th
...
reset
marker reset include program.4th
But note that the marker does not reset any corruption you may have
left in the Forth system, it just forgets the program.
- anton
For a complicated system like the optimiser I'm working on,What are those? Quick google in the docs or forth standard website doesn't give me any hits.
I rely on REGRESS statements in the source, as a tiny difference
can trigger a failed test unexpectedly.
gforth program.4th -e "<code> bye"
On Thursday, March 16, 2023 at 6:35:06 AM UTC-6, none albert wrote:
For a complicated system like the optimiser I'm working on,What are those? Quick google in the docs or forth standard website
I rely on REGRESS statements in the source, as a tiny difference
can trigger a failed test unexpectedly.
doesn't give me any hits.
I have discussed this at this panel. They are like C's assert().
They perform a test and failing that, they kill the program's
compilation, giving additional information.
In production REGRESS is redefined as a comment.
An example is
: add ... ;
REGRESS 1 2 add S: 3
Groetjes Albert
On Tuesday, March 21, 2023 at 10:14:58 AM UTC+1, none albert wrote:
[..]
I have discussed this at this panel. They are like C's assert().
They perform a test and failing that, they kill the program's
compilation, giving additional information.
In production REGRESS is redefined as a comment.
An example is
: add ... ;
REGRESS 1 2 add S: 3
Groetjes Albert
Just curious: do you some statistics on REGRESS ? (How many triggers
do you have once debugging is over?)
-marcel
Every time I try forth, I start some interpreter, type some words, then it works and I feel like I want to learn more and want to write some code to actually try it out. But every time I hit a wall.process that I can imagine working, but it is crude, and prone to numerous mistakes:
For example yesterday I installed SwiftForth, I read the documentation and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it. This is the
1. Open interpreter, write some code, test it until it workst remember anymore what they were.
2. Hope that SwiftForth doesn't crash and you don't loose all your progress 3. Scroll up through the history or list the words, and hope I copy paste stuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire, manually type INCLUDE my-updated-file
SwiftForth doesn't seem to have a command line arguments help in the documentation PDF, nor there seem to be a way to reset the state of a interpreter. At least I couldn't find any. I had similar issues with other interpreters some time back, but I can'
I'm probably missing something obvious, or there's something I don't get.I learned this trick watching someone else ( I would give credit if i could remember who) I have planned on expanding the code to make it more universal but haven't got around to it yet here is the ex. i use for gforth in ecr.fs
Every time I try forth, I start some interpreter, type some words, then it works and I feel like I want to learn more and want to write some code to actually try it out. But every time I hit a wall.process that I can imagine working, but it is crude, and prone to numerous mistakes:
For example yesterday I installed SwiftForth, I read the documentation and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it. This is the
1. Open interpreter, write some code, test it until it workst remember anymore what they were.
2. Hope that SwiftForth doesn't crash and you don't loose all your progress 3. Scroll up through the history or list the words, and hope I copy paste stuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire, manually type INCLUDE my-updated-file
SwiftForth doesn't seem to have a command line arguments help in the documentation PDF, nor there seem to be a way to reset the state of a interpreter. At least I couldn't find any. I had similar issues with other interpreters some time back, but I can'
I'm probably missing something obvious, or there's something I don't get.Sorry all i forgot to add the the new forth word empty needs to be the first call in file.fs
On Tuesday, March 14, 2023 at 12:25:50 PM UTC-4, Yaroslav Veremenko wrote:process that I can imagine working, but it is crude, and prone to numerous mistakes:
Every time I try forth, I start some interpreter, type some words, then it works and I feel like I want to learn more and want to write some code to actually try it out. But every time I hit a wall.
For example yesterday I installed SwiftForth, I read the documentation and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it. This is the
can't remember anymore what they were.1. Open interpreter, write some code, test it until it works
2. Hope that SwiftForth doesn't crash and you don't loose all your progress
3. Scroll up through the history or list the words, and hope I copy paste stuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire, manually type INCLUDE my-updated-file
SwiftForth doesn't seem to have a command line arguments help in the documentation PDF, nor there seem to be a way to reset the state of a interpreter. At least I couldn't find any. I had similar issues with other interpreters some time back, but I
otherwise setup a ~/.SwiftForth-editor script chmod +x and just call EDIT in swiftforth. i am no swiftforth expert the reason for my vagueness.I'm probably missing something obvious, or there's something I don't get.I learned this trick watching someone else ( I would give credit if i could remember who) I have planned on expanding the code to make it more universal but haven't got around to it yet here is the ex. i use for gforth in ecr.fs
**************************** ecr.fs **********************************
: empty s" ---marker--- marker ---marker---" evaluate ;
: edit s" vim file.fs" system ;
: run s" file.fs" included ;
: ecr edit run ;
marker ---marker--- ******************************************************************** basically replace file.fs in the code with the file you are working on...... then gforth ecr.fs ..... while in gforth type ecr <ret>
it will restore the dictionary to initial point run vim file.fs when you exit vim saving or not it will include file.fs and return you to gforth. it keeps you from compiling on top of yourself hence redefining. this should work on most forth's.
From Veltas repo of Christopher Leonard I use this scriptin function to
add words to external file
\ github.com/Veltas/demo/blob/main/script.4th
\ Copyright 2023 Christopher Leonard - MIT Licence
: CREATE-FILE! CREATE-FILE ABORT" failed to open file" ;
Em segunda-feira, 24 de julho de 2023 às 12:34:56 UTC-3, David Gipson escreveu:the process that I can imagine working, but it is crude, and prone to numerous mistakes:
On Tuesday, March 14, 2023 at 12:25:50 PM UTC-4, Yaroslav Veremenko wrote:
Every time I try forth, I start some interpreter, type some words, then it works and I feel like I want to learn more and want to write some code to actually try it out. But every time I hit a wall.
For example yesterday I installed SwiftForth, I read the documentation and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it. This is
can't remember anymore what they were.1. Open interpreter, write some code, test it until it works
2. Hope that SwiftForth doesn't crash and you don't loose all your progress
3. Scroll up through the history or list the words, and hope I copy paste stuff that's important to a separate text editor
4. Close SwiftForth, start it again, wait for evaluation warning to expire, manually type INCLUDE my-updated-file
SwiftForth doesn't seem to have a command line arguments help in the documentation PDF, nor there seem to be a way to reset the state of a interpreter. At least I couldn't find any. I had similar issues with other interpreters some time back, but I
otherwise setup a ~/.SwiftForth-editor script chmod +x and just call EDIT in swiftforth. i am no swiftforth expert the reason for my vagueness.I'm probably missing something obvious, or there's something I don't get.I learned this trick watching someone else ( I would give credit if i could remember who) I have planned on expanding the code to make it more universal but haven't got around to it yet here is the ex. i use for gforth in ecr.fs
**************************** ecr.fs **********************************
: empty s" ---marker--- marker ---marker---" evaluate ;
: edit s" vim file.fs" system ;
: run s" file.fs" included ;
: ecr edit run ;
marker ---marker--- ******************************************************************** basically replace file.fs in the code with the file you are working on...... then gforth ecr.fs ..... while in gforth type ecr <ret>
it will restore the dictionary to initial point run vim file.fs when you exit vim saving or not it will include file.fs and return you to gforth. it keeps you from compiling on top of yourself hence redefining. this should work on most forth's.
https://youtu.be/mvrE2ZGe-rs?t=1305
In article <eefa62f9-eab0-4c2b...@googlegroups.com>,Thank you for helping give credit where credit is due. i loved that video and wished to find a whole series by this person ..... amazing skill both programming and teaching.
gobli...@gmail.com <gobli...@gmail.com> wrote:
From Veltas repo of Christopher Leonard I use this scriptin function to >add words to external file
\ github.com/Veltas/demo/blob/main/script.4th
\ Copyright 2023 Christopher Leonard - MIT Licence
: CREATE-FILE! CREATE-FILE ABORT" failed to open file" ;Normally these kind of stuff doesn't go wrong.
Routinely I do
CREATE-FILE THROW
Only in the debugging face it fails. Other wise you are advised
to generate more specific messages if
'complicate-stuff-that-creates-init-file CATCH DUP 31 =
ABORT" You probably tried to create an init file where you have not \
write access on the directory"
This also show why I prefer numeric identification for error situation
and I abhor the reuse of same error numbers for vastly different errors.
It is a myth that a one line abort" message does cut it.
This is the documentation of error 121 for my bsl package.
"
121 : line is not stable before character
A character is expected, so we wait for a start bit.
If the line is already in a start bit / break state, that
means that it is stuck in that state, or that we were too slow
and the sbc has already started sending.
If you get this error consistently then we are stuck in that
state.
This is indicative of
1) A wrong cable connection.
Use the -t option to diagnose your cable. Check the connections.
2) your parallel port doesn't use the standard address.
Use ` -a #### ' to specify the proper address.
(Mostly you get 134 with that problem.)
If the fault is intermittent, at least the msp430 can control
the line, but it does so erratically.
3) Your pc is too slow. Terminate time consuming processes, like
a gui.
4) A defective MSP430 or faulty bsl in MSP430. This has been
seen in combination with a wrong patch of the bsl.
"
If bsl fails you see "error 121", but you know where to look.
Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring. You must not say "hey" before you have crossed the bridge. Don't sell the hide of the bear until you shot it. Better one bird in the hand than ten in the air. First gain is a cat spinning. - the Wise from Antrim -
On Tuesday, July 25, 2023 at 4:48:28 AM UTC-4, none albert wrote:As to the original question about saving progress in swift forth i looked in the pdf documents and there is an excellent section talking about the words forget remember marker and the word G along with an example ~/.SwiftForth-editor script to run vim
In article <eefa62f9-eab0-4c2b...@googlegroups.com>,
gobli...@gmail.com <gobli...@gmail.com> wrote:
From Veltas repo of Christopher Leonard I use this scriptin function to >add words to external file
\ github.com/Veltas/demo/blob/main/script.4th
\ Copyright 2023 Christopher Leonard - MIT Licence
: CREATE-FILE! CREATE-FILE ABORT" failed to open file" ;Normally these kind of stuff doesn't go wrong.
Routinely I do
CREATE-FILE THROW
Only in the debugging face it fails. Other wise you are advised
to generate more specific messages if
'complicate-stuff-that-creates-init-file CATCH DUP 31 =
ABORT" You probably tried to create an init file where you have not \ write access on the directory"
This also show why I prefer numeric identification for error situation
and I abhor the reuse of same error numbers for vastly different errors.
It is a myth that a one line abort" message does cut it.
This is the documentation of error 121 for my bsl package.
"
121 : line is not stable before character
A character is expected, so we wait for a start bit.
If the line is already in a start bit / break state, that
means that it is stuck in that state, or that we were too slow
and the sbc has already started sending.
If you get this error consistently then we are stuck in that
state.
This is indicative of
1) A wrong cable connection.
Use the -t option to diagnose your cable. Check the connections.
2) your parallel port doesn't use the standard address.
Use ` -a #### ' to specify the proper address.
(Mostly you get 134 with that problem.)
If the fault is intermittent, at least the msp430 can control
the line, but it does so erratically.
3) Your pc is too slow. Terminate time consuming processes, like
a gui.
4) A defective MSP430 or faulty bsl in MSP430. This has been
seen in combination with a wrong patch of the bsl.
"
If bsl fails you see "error 121", but you know where to look.Thank you for helping give credit where credit is due. i loved that video and wished to find a whole series by this person ..... amazing skill both programming and teaching.
Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring. You must not say "hey" before you have crossed the bridge. Don't sell the hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -
For example yesterday I installed SwiftForth, I read the documentation
and it has few pages on source management. The only word that seem to matter to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it.
SwiftForth doesn't seem to have ...
a way to reset the state of a interpreter.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 34:25:44 |
Calls: | 6,707 |
Files: | 12,239 |
Messages: | 5,353,328 |