u/tabemann

Image 1 — A simple HTTP file server for zeptoforth
Image 2 — A simple HTTP file server for zeptoforth
▲ 26 r/Forth

A simple HTTP file server for zeptoforth

On top of my extensible HTTP server for zeptoforth, I have now created a simple HTTP file server for zeptoforth which serves files and directories from FAT32 filesystems, whether from 'blocks' storage, SD cards, or PSRAM RAM disks.

Note that it is read-only, which is important because it has no security (as the HTTP server is strictly HTTP, not HTTPS) beyond limiting access to a given base path on a given filesystem and rejecting HTTP requests crafted to include . or ...

The source code is at https://github.com/tabemann/zeptoforth/blob/master/extra/rp_common/net_tools/http_server_files.fs.

u/tabemann — 3 days ago
▲ 36 r/Forth

An extensible, user-friendly HTTP server for zeptoforth

I implemented an extensible, user-friendly HTTP server for zeptoforth along with a simple demo which shows its features. These are compatible with both zeptoIPv4 and zeptoIPv6 without needing any duplication of code to support both.

One simply registers fixed and prefix URI handlers which access the HTTP request via key and emit, enabling normal Forth console I/O words to be used to serve HTTP requests. Additionally, handlers have access to the URI being served and the HTTP method in question. The HTTP server does the rest. Note that the HTTP server is multithreaded, with each request getting its own task.

The source code for the HTTP server is at https://github.com/tabemann/zeptoforth/blob/master/extra/rp_common/net_tools/http_server.fs.

The source code for the demo is at https://github.com/tabemann/zeptoforth/blob/master/test/rp_common/http_server_demo.fs.

u/tabemann — 3 days ago

Familiarity with some dialectal English forms

I was wondering how much English-speakers, both non-native and native, from outside the Upper Midwest are familiar with a variety of forms which I am used to readily using in everyday English which I have not really seen discussed in discussions of dialectal English.

These are very much part of my home English, and I will use them with people in stores and like, but I avoid them at work, particularly since I work with many non-native English-speakers.

Particularly I am wondering whether I am correct in thinking that these sorts of forms are likely to confuse non-native English-speakers who may be less familiar with dialectal English.

The phonemes I give are cross-dialectal English phonemes, while the phones I give are the specific ones I actually use. Note that some of the phonemes given are counterintuitive because they are required to explain the surface forms seen (e.g. with regard to vowel length) but do not directly map to surface forms in an obvious fashion.

  • /ˈaɪˌoʊntnoʊ/ [ˈaːˌõ̞no̞(ː)] "I don't know"
  • /ˈaɪˌoʊnt/ [ˈaːˌõ̞ʔ(t)], [ˈaːˌõ̞n] "I don't"
  • /ˈwaɪˌoʊnt/ [ˈwaːˌõ̞ʔ(t)], [ˈwaːˌõ̞n] "why don't"
  • /ˈhiːˌʌzənt/ [ˈçiːˌʌːzɘ̃ʔ(t)], [ˈçiːˌʌːzɘ̃n] "he doesn't"
  • /ˈʃiːˌʌzənt/ [ˈʃiːˌʌːzɘ̃ʔ(t)], [ˈʃiːˌʌːzɘ̃n] "she doesn't"
  • /ˈaɪwəz/ [ˈaːɵːs] "I was"
  • /ˈjuːwər/ [ˈjuːʁ̩ˤʷ(ː)] "you were"
  • /ˈhiːwəz/ [ˈçiːɵːs] "he was"
  • /ˈʃiːwəz/ [ˈʃiːɵːs] "she was"
  • /ˈwiːwər/ [ˈwiːʁ̩ˤʷ(ː)] "we were"
  • /ˈðeɪwər/ [ˈte̞ːʁ̩ˤʷ(ː)] "they were"
  • /æt/ [ɛʔ(t)] "that"
  • /jɑː/ [ja(ː)] "yes"
  • /ˈoʊər/ [o̞ːːʁˤ] "over"
  • /ˈaʊtə/ [ˈɑ̆ɔ̯̆ə(ː)], [ɑː] "out of"
  • /ˈɛniː/ [ɜ̃ːj] "any"
  • /ˈmɛniː/ [mɜ̃ːj] "many"
  • /ˈmeɪiː/ [me̞ːj] "maybe"
  • /ˈprɑːliː/ [ˈpʰʁ̥ˤɑːɯ̯i(ː)], [ˈpʰʁ̥ˤɑːj] "probably"
  • /ˈprɑːbm/ [ˈpʰʁ̥ˤɑːmː] "problem"
  • /ˈlɪtərliː/ [ˈʟ̞ɪːʁˤɰi(ː)] "literally"
reddit.com
u/tabemann — 17 days ago
▲ 19 r/Forth

A blocks game for zeptoforth on the PicoCalc

I created a blocks game for zeptoforth on the PicoCalc that will run on both the RP2350 and RP2040. It is sufficiently different from Tetris that there should be no problems with DMCA requests coming from The Tetris Company.

The game mechanics involve randomly falling blocks and a currently selected block, where the user can destroy groups of identically-colored blocks, with bonuses for the number of blocks destroyed at once (as any group of blocks is worth the number of blocks to the power of two), while trying to keep the blocks from reaching the top. To avoid the user just hammering the space bar, destroying blocks is rate-limited. The player loses when the game attempts to add a block to a column which is already full. (The user can also exit early if they get bored.)

The source code is at https://github.com/tabemann/zeptoforth/blob/master/test/rp_common/picocalc_block_game.fs.

u/tabemann — 19 days ago
▲ 16 r/Forth

zeptoforth 1.16.3 is out

You can get this release from https://github.com/tabemann/zeptoforth/releases/tag/v1.16.3.

This release:

  • adds support for 'raw keys' on the PicoCalc as a mechanism for directly exposing key press codes reported by the STM32 microcontroller.
  • adds a 'keymap' mechanism on top of 'raw keys' on the PicoCalc as a means of conveniently querying whether a given key has been pressed or released.
  • adds support for the 6x12 font to the PicoCalc installers.
reddit.com
u/tabemann — 29 days ago
▲ 12 r/Forth

A couple games for zeptoforth on the PicoCalc

A while back I implemented a couple games for zeptoforth on the PicoCalc, specifically Snake and Rocks (a Asteroids clone minus the flying saucers).

Over the weekend I revisited them to add support for a new optional 'keymap' capability built on top of an also-new 'raw' keys mechanism. It is in the master branch of zeptoforth but is not released yet, so if you want to try out these games in their latest forms I would suggest git cloning the latest zeptoforth and rebuilding zeptoforth on your PicoCalc from source (if you have done this before you would know there is an installer script for automating this process). After you do so, load extra/rp_common/picocalc_keys.fs, as this is needed for the games but is not installed by the zeptoforth-for-the-PicoCalc installer (to save space for those misguided enough to use an RP2040 in their PicoCalc).

You can get the latest incarnation of Snake from test/rp_common/picocalc_snake_keys_enhanced.fs and of Rocks from test/rp2350/picocalc_rocks_recoil.fs. Note that the latest version of Rocks introduces recoil, which previous versions lacked.

If you do not wish to reinstall zeptoforth on your PicoCalc you can get older versions of Snake from test/rp_common/picocalc_snake.fs and Rocks from test/rp2350/picocalc_rocks.fs. Note though that these versions have less precise controls, and this version of Rocks also lacks recoil.

And of course, this post would not be complete without screenshots:

Snake in action

Rocks in action

reddit.com
u/tabemann — 1 month ago
▲ 16 r/Forth

You can get this release from https://github.com/tabemann/zeptoforth/releases/tag/v1.16.2 .

This release:

  • fixes a bug in schan::schan-full? that made it incorrectly report a full condition when an schannel contained only one message.
  • adds support for setting bus priorities on the RP2040 and RP2350 with the busctrl module.
  • adds support for obtaining the number of free blocks with block::free-block-count@.
  • adds a 6x12 font.
  • adds support for ST7796S displays, including for PicoCalc emulation.
  • adds support for LCD1602 with PCF8574 interface, as opposed to AiP31068L.
u/tabemann — 2 months ago