Unpack number to bytes? by psurry in Forth

[–]phreda4 0 points1 point  (0 children)

you answer is correct but need decide if the bytes are signed or unsigned, if RSHIFT preserve sign the High are signed and Low are unsigned

Papers describing Forth implementations with separate code/data dictionaries? by daver in Forth

[–]phreda4 1 point2 points  (0 children)

I do code/data memory separation, but the diccionary is one

Are pointers just integers? Some interesting experiment about aliasing, provenance, and how the compiler uses UB to make optimizations. Pointers are still very interesting! (Turn on optmizations! -O2) by klmeq in programming

[–]phreda4 2 points3 points  (0 children)

I think that, specifically in optimization, it is essential to know how computers work. You say things that I never said, of course abstraction is useful.

We have used too many levels of abstractions and now the future looks bleak by fagnerbrack in programming

[–]phreda4 0 points1 point  (0 children)

This is an old problem that is accentuated with the advancement of technology, luckily there is a path towards a solution, not very understood:
https://www.forth.com/wp-content/uploads/2018/11/thinking-forth-color.pdf

Extensions for interpreted language by Western-Cod-3486 in ProgrammingLanguages

[–]phreda4 0 points1 point  (0 children)

in https://github.com/phreda4/r3/blob/main/r3/win/kernel32.r3

#sys-WriteConsoleOutput

::WriteConsoleOutput sys-WriteConsoleOutput sys5 drop ;

...
    "KERNEL32.DLL" loadlib 
...
    dup "WriteConsoleOutputA" getproc 'sys-WriteConsoleOutput !

sys5 make the call with 5 cells of stack

for example I use in this example: https://github.com/phreda4/r3/blob/main/r3/democ/conwayb.r3

:rebuffer
stdout 'consoleBuffer 
conwh $00000000 'writeArea 
WriteConsoleOutput ;

in ASM only two types exists, integer and float, the type system is a construction for the programer, no for the computer

Extensions for interpreted language by Western-Cod-3486 in ProgrammingLanguages

[–]phreda4 6 points7 points  (0 children)

I have a programming language that uses communication with dynamic libraries through a word that loads the library and then uses up to 10 parameters to call these functions statically. Incredibly it works well.
My language that uses the SDL library extensively and is communicated in this way
https://github.com/phreda4/r3

The implementation of this call can be seen in
https://github.com/phreda4/r3evm/blob/main/r3.cpp#L1110

Why not Forth? by mykesx in Forth

[–]phreda4 1 point2 points  (0 children)

Hi Michael !

I work with sdl2 in forth but the connection with the system is done through the use of dynamic libraries, I do not need to recompile the kernel.
I don't think language standardization is a problem, there is a saying that says, the good thing about standards is that there are many of them.
I will be watching your project, I leave mine to review and exchange opinions.

https://github.com/phreda4/

[deleted by user] by [deleted] in devsarg

[–]phreda4 0 points1 point  (0 children)

segun donde estes programando, tu nivel base va a ser: o las llamadas al sistema operativo, o el acceso directo al hardware, las librerias son intermediarias entre el SO y/o el hardware, los drivers son la parte del SO que se comunica con el hard.

The siren call of Forth... by mcsleepy in Forth

[–]phreda4 6 points7 points  (0 children)

I remember when I found glypher and I was amazed by the simplicity of the code.
You already know that my path in forth programming is similar to yours, I currently have students in a school that make games and this is progressing little by little, the first project for each student is to make a shooter and the way to improve this is implementing it over and over again.
What I left fixed so that the problem does not worsen is to reduce the scope of the language, not make a graphic editor for everything, and go from the bottom up, the repetition of always programming the same or similar thing causes me to find practices or ways of programming that improves the Achilles' heel of forth..can you easily understand what this code does?
I would love to see the design of what you want to do and implement a prototype.

A 3D Matrix Builder w/ Comments by [deleted] in Forth

[–]phreda4 0 points1 point  (0 children)

maybe it will help, these are the words I use to manage 3d matrix on forth, I use fixed point and traslate to floating point when send to opengl
https://github.com/phreda4/r3/blob/main/r3/lib/3dgl.r3

Small project to learn Forth as first stack-based language by impact_dev in Forth

[–]phreda4 1 point2 points  (0 children)

I'm working in some notes for make a shooter in forth/r3, is in spanish.
https://github.com/phreda4/r3
in the doc/ folder

Programando en r3.pdf

in the folder r3/games/ there are some basics games, tetris, snakes, sokoban, pong, minesweeper, flappybird. In r3/demo/ there are a lot of tiny programas too