u/mykesx

▲ 19 r/Forth

Inspiration Forth, my view of AI

I was recently accused of using AI to make some of inspiration Forth, which isn’t true. The reason I was accused is that I didn’t completely edit the default README file created by gitlab when I made the repo. The README described what makes for a good README and had headers/sections pre made with instructions on what kind of things to add there. Both github and gitlab have had this sort of thing for years - I have maybe 50 or even 100 repos I made over the years. The README is a template, created by humans. They also have optional templates for issues to force people to add things like steps to reproduce and so on. I didn’t choose to use these.

I cannot stand the use of AI to make code, period. When I was working on the Console logic for Inspiration, it took several feature branches to move it along. The first being to just render individual characters on the screen, then colorized text, then cursor addressing, then (partial) ANSI escape sequence support, then ability to scroll back and view all the text printed to the console. These feature branches weren’t consecutive efforts. It took me a lot of thought to figure out the scroll back logic, and more than one aborted feature branch. So I worked on other things in the meanwhile.

The only time I used AI was a horrifying experience. I asked copilot to make a console with ANSI and scrollback support. It made it in seconds. When I looked at it, I saw someone else’s variable names. Logic that would take me days to get into before even trying to assess if it was even working code. I stopped looking at it after a few seconds. I felt like that code was lifted from someone else, without attribution. None of that code or any of its ideas has anything to do with Inspiration.

The Phred editor is something I worked on in my previous Forth implementations, and once in C++. Made from scratch, but patterned after vim. The Evade2 game is one I made 7 years ago for the company I worked for at the time. Originally in C++, I ported it in Forth to Inspiration.

Inspiration is a different animal as Forths go. It is graphics first, not console first. The concept of how C++ functions can be subroutine threaded is unique. The pthread ability is my own idea and creation. Every code word I made are either mine or from the 2012 Forth Standard.

I have no use for AI. The beauty of a desktop Forth is that my dictionary has thousands of words I already made and debugged to make new things from. And rapidly. I probably get more done in 2 days than I would with AI. It helps that I have been writing code since the early 1970s. I’ll let the features/issue board and over 800 commits to Inspiration speak for themselves.

Beyond this, I think AI slop is garbage and spam. It’s turning works of art into someone else’s trash. GitHub is becoming a landfill. Why GitHub? Because that’s where the chat bots tell people to upload their one day untested creations.

reddit.com
u/mykesx — 3 days ago
▲ 21 r/Forth

Inspiration on Raspberry Pi 4

It took about 2 hours to install a fresh Alpine Linux on the Pi 4, along with my dotfiles, neovim, g++, make, git, and the SDL2 libraries. It took 1-2 minutes, maybe, to compile. I didn’t time it.

I had to remove one CODEWORD so I could eliminate libbsd and it compiled. Ran first time!

What this video shows is performance on the Pi 4. It “feels” 80-90% as fast as on my MBP.

https://gitlab.com/mschwartz/inspiration

u/mykesx — 5 days ago
▲ 20 r/Forth

Another Game Engine Demo for Inspiration Forth

Inspiration's game engine is general purpose. The last update, I posted a 2D x/y scrolling space game with planets you could fly to.

This update, I'm using the same game engine to show this 2.5D FPS type game.

It's not quite ready to beta test, I just thought the game looks neat.

Repo is at https://gitlab.com/mschwartz/inspiration. Tested on Mac and Linux.

ZERO AI used to make any of part of Inspiration or its Forth implementation.

To give you an idea of what the Forth source looks like, here's the entirety of the Bullet logic.

require Games/img/bullet.4ti

private{

2f 2f + 2f + CONSTANT BULLET-ROTATE

: Bullet.Run { me | spr -- , Move Bullet }
    me s@ Process.sprite -> spr
    spr s@ Sprite.rz BULLET-ROTATE + spr s! Sprite.rz
    spr s@ Sprite.z CameraZ - fixed>int 512 > if 
        spr Sprite.Free
        nullptr me s! Process.sprite
        me Process.Suicide
    then
    ;

}private

: Bullet.New { | p spr -- , Fire bullet }
    0 PTYPE-USER Process.New -> p
    ['] Bullet.Run p Process.SetState
    1 p s! Process.timer

    STYPE-PBULLET bullet_img   VectorSprite.New -> spr
    STYPE-ENEMY spr s! Sprite.cmask

    bullet_img 1+ c@ spr s! Sprite.height
    bullet_img c@ spr s! Sprite.width
    bullet_img c@ spr s! Sprite.depth

    spr p s! Process.Sprite
    $ ffff0000 spr s! Sprite.color

    p
    ;

privatize

And this is the player controls logic that handles firing the bullet:

: Player.FireBullet { pf me | p spr -- , fire bullet }
    Bullet.New -> p
    p s@ Process.sprite -> spr


    // alternate bullets fired from left then right
    me s@ Process.user-data 1 and if
        pf s@ Playfield.worldX BULLETDX + spr s! Sprite.x
    else
        pf s@ Playfield.worldX BULLETDX - spr s! Sprite.x
    then
    me s@ Process.user-data 1+ me s! Process.user-data


    CameraY spr s! Sprite.y
    CameraZ 1f + spr s! Sprite.z


    pf s@ Playfield.worldVZ BULLET-VELOCITY + spr s! Sprite.vz


    p GameEngine.Birth
    ;


: Player.Run { me | ch pf p spr -- , Player logic }
    GameEngine.playfield @ -> pf
    KEY_QUIT    Controls.KeyPressed? if Evade2.Quit then
    ascii q     Controls.KeyPressed? if Evade2.Quit then


    KEY_LEFT Controls.KeyDown? if pf me Player.ControlLeft then
    KEY_RIGHT Controls.KeyDown? if pf me Player.ControlRight then
    KEY_UP Controls.keyDown? if pf me Player.ControlUp then
    KEY_DOWN Controls.KeyDown? if pf me Player.ControlDown then
    BL Controls.KeyPressed? if pf me Player.FireBullet then
    KEY_ESC Controls.KeyPressed? if GameOver then


    Player.RenderCrosshairs
    ;
u/mykesx — 9 days ago

Installer question

The installer automatically can install lamine and snapshot facility, which is a manual thing on Arch. I love it, but wonder if the installer couldn't do much more?

Some combination of dmidecode, lspci, dmesg, etc., should allow things like Nvidia card, laptop brand, and more to be detected and user asked if the current best driver and/or packages to be installed.

Examples,

dmidecode on my 2014 MBP returns MacBook11,1. Based on that, mbpfan and whatever other MacBook utilities could be installed and configured. The BCM WiFi driver also needs to be installed for WiFi to work.

Asus and Dell have similar brand specific fan and other utilities.

Newer Nvidia drivers don't work on older cards, so the old driver should be installed.

For dual display adapters, auto switching software can be installed automatically.

Maybe it's beyond the scope of what CachyOS philosophy is?

I don't think it's that easy to get perfect, and there are a lot of permutations of hardware configurations. But over time, the installer would evolve to cover most things. And anything it would install would require user to approve.

Thoughts?

reddit.com
u/mykesx — 13 days ago
▲ 22 r/Forth

Notepad clone for Inspiration

I made this Notepad.exe (windows-like) app for Inspiration. It's written in Forth, including the Menu system. It's not 100% complete, but close. The only remaining task is to implement selection and cut/copy/paste. The selection logic is in progress, but you can see what it's going to look like.

It does feature undo/redo.

Time spent making this app was about 2 days.

No AI ever used to make any of Inspiration. None ever will.

The License is MIT Non-AI

The repo:

https://gitlab.com/mschwartz/inspiration

u/mykesx — 14 days ago
▲ 1.4k r/homelab

Cloudflare stock sinks 16% after earnings as company cuts 1,100 employees due to AI changes

So many use cloudflare services here. Thought this would be of interest.

cnbc.com
u/mykesx — 14 days ago
▲ 38 r/Forth

More Inspiration, in progress

I've been working on some game demos. As you can see in the video, I have a good start on a game engine in Forth, with physics and sprite engine and state machine for controls/enemy intelligence.

The video shows a huge universe with 3 sprites, 2 positioned far off screen. The arrow keys apply thrust in the direction. If no key is pressed, friction is applied to bring the speeds to a stop.

The starfield is rendered at 1/2 world velocity for a parallax effect.

I started on this yesterday and this is how far I got by this morning. I wrote only Forth code for this. Downloaded the planet sprites from a free clip art site.

Zero AI assist used in any of Inspiration development.

I can't add photos and video for some reason. I can start another thread if people want to see more.

Or you can look for screenshots in the repo:

https://gitlab.com/mschwartz/inspiration

u/mykesx — 15 days ago

I posted about the lack of Forth language support the other day…

I’m posting to say I used Zed all day yesterday without any Forth support and I was productive enough.

I was able to set up my key bindings to match what I am used to.

I like it. It’s fast and much more useable than VS Code.

Setting up the debugger was really awkward though. It wanted to use the .vscode config and even if I created one in .zed, it seems the .vscode one has priority. And Zed doesn’t implement the vscode workspace* variables so it won’t work. I did eventually get it working, but it’s an annoyance.

The only thing missing is the ability to toggle comments in Forth code. I am hoping that the ticket to support Forth will be done soon.

I don’t care about sharing my work here, but I will leave a link to my current project because it may be of use to whoever wants to check out the Forth support against my Forth sources.

https://gitlab.com/mschwartz/inspiration

TL;DR 99% happy convert.

u/mykesx — 16 days ago
▲ 90 r/homelab

How many AI slop dashboard threads per day/week are truly of value to homelabbers? A few today in my reddit feed.

I don't get the sense the people making the posts even have much interest in homelab or have one. The people who upvote these seem to be alt accounts or people who don't participate in this sub. Or to bring attention to the wall of negative replies by those who consider it spam, lazy, uninteresting...

It is a whole different thing to have a homelab with significant horsepower and RAM to run LLMs in the homelab. It's also a different story for people who post here regularly who have real interest in sharing their projects with the rest of us.

I have had a homelab since the 1980s and I have no desire to even try these AI slop things.

Do we really like this?

https://www.reddit.com/r/homelab/s/bUgHzRu7kq

Edit:

  1. It is literally spam. Exactly like the cheap vIaGrA ones you might see in emails or on unmoderated message sections of blogs.
  2. A link on Reddit is gaming the search engines and AI. It’s not only about “look what I made!” It’s karma farming, farming for stars on GitHub.
  3. It’s disrespectful and surely violates multiple rules.
  4. Where people do respond, it turns into a flame fest.

So there are solutions.

How about merging them into a single thread?

How about allowing posts with repositories 3 months old with 100+ commits?

There are reasonable options.

Today: https://www.reddit.com/r/homelab/s/0bc2cfcTMY

https://www.reddit.com/r/homelab/s/sKHE9LwmPA

reddit.com
u/mykesx — 18 days ago

I made this game for Modus Create in 2017. For Christmas, we would make a game for some device like Arduboy and hand out a few hundred to our clients. It was a few weeks of work.

You can play the game in the first post here:. https://community.arduboy.com/t/evade-2-arduboys-first-space-flight-sim/4634

The repo is here: https://github.com/ModusCreateOrg/evade2

I designed this game to fit the Arduboy. It turned out to be a clever choice, IMO. The display monochrome 160x100...

The software was written in C++ using CLion. I built a fully compatible MacOS version of the game engine using SDL2 and we developed using that. We had a minor bit of work to get the engine working on device. CLion allowed us to use a high level debugger to find and fix bugs - doing so on device would have been painfully slow.

Jay Garcia did the music and some of the game play tweaks. I did the engine design, SDL and target code, 3D effects, controls, enemy AI, and made it all fit in a small resources device. A third team member did some of the porting work, line drawing routines, and the vector data for what you see. The HUD was a bitmap.

Cheers

reddit.com
u/mykesx — 19 days ago

I tried the editor and I was disappointed in the lack of syntax highlighting for Forth language code. I liked the look and the speed, but the lack of Forth support makes it a non starter. I realize Forth is a niche language but it is decently supported by vim, neovim, emacs, and VS Code.

Also, I found the overall documentation to be confusing and contradictory - especially with C++ support.

The downloads page suggests that you should download one or more versions depending on your language needs. There IS a Forth Zed download, but it's not clear if it also supports JavaScript, C, C++, and other languages as well. As well, why a Forth version but no support in other ways?

I am not here to be critical. I am a power user and I would love to switch from VS Code (+ neovim plugin). These are observations of a new user, fresh eyes and experience.

Cheers

reddit.com
u/mykesx — 20 days ago
▲ 20 r/Forth

Inspiration has graphics primitives that would make Gnome (or other graphical UIs/Window Managers) style Menus/MenuButtons/Toolbars, Text style menus like we had in the old MS-DOS days seem more in the spirit of Forth.

I enhanced the TUI library to include MenuBars and MenuItems and ability to handle Forms and/or MenuBars without a lot of boilerplate code - simply by calling SetMenu ( menubar -- , set menubar for current thread ) or SetForm and using TUI.Key instead of key to read keys.

Events are handled as special keys, much like F1-F12, Cursor Keys, etc. You elect to receive them and they come in via KEY (or TUI.Key). Events you can enable include WindowResize, WindowActivated, WindowDeactivated, MouseDown, MouseUp, ContextDown, ContextUp, KeyDown, KeyUp, MouseMove, MouseWheel, etc.

Anyhow, the images above show what these menus look like and what the code looks like to create a MenuBar with MenuItems.

As usual, not a single character of text (or anything else) in this project has anything to do with AI - no AI was used. I don't see the point, as learning along the way is far more important than having an untested app built in seconds by AI.

The repo:

https://gitlab.com/mschwartz/inspiration

u/mykesx — 1 month ago
▲ 7 r/Forth

Below is the CODEWORD for USER. USER creates a pthread local variable. Each Forth thread (pthread) gets a private copy/version of these USER variables. A good use case is:

USER BASE

Every thread needs its own BASE variable or there'd be contention among the threads for a global BASE variable.

There are numerous use cases for USER variables - like in the Phred editor, each running editor window (a thread per) has a USER variable to point to the Buffers loaded in the editor. Or in the FileManager app, each instance would need a unique USER PATH variable so you can change directories independently in each window.

There's also USER-ALLOT so you can allocate arrays or more complex structures in USER memory.

How it works is each Thread instance allocates 32K (a settings/option value) of RAM and stores it in a variable that _USER_START returns (USER-START in Forth). There's one global user_next variable that holds the next index into this allocated RAM. Each thread shares the same index but has a different USER-START.

The IMMEDIATE USER CODEWORD (I'm not yelling!) below allocates an index and compiles code to push the index, push the address of the allocated user memory, and adds them together.

https://preview.redd.it/2for71yw5dwg1.png?width=831&format=png&auto=webp&s=77284cb8078bc6f5d66a73dd0063db38c893db82

In action:

https://preview.redd.it/92cm8mmh7dwg1.png?width=421&format=png&auto=webp&s=183475dfe967f731b3645dd65b66f1f5d886bb18

reddit.com
u/mykesx — 1 month ago