frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: SFX – A language where 0.1 and 0.2 = 0.3 and Context is first-class

https://github.com/roriau0422/sfex-lang
11•roriau•2mo ago
I've spent the last few weeks building SFX in Rust. It's a programming language experiment focused on context-oriented programming with some unusual design choices.

Reality check first:

Solo project, 53 commits

1 GitHub star xD

Zero users besides me

No production usage

Documentation is aspirational

Many stdlib modules are minimal stubs

What actually works:

Basic interpreter (tree-walker)

Arbitrary precision decimals (0.1 + 0.2 = 0.3)

1-based indexing (controversial, I know)

Context/Situation system (the main idea)

Some file I/O and basic networking

JIT hooks exist but optimization is minimal

The Context idea (asking for feedback on this):

Instead of checking if (user.isAdmin) everywhere, you define Situation: AdminMode that overrides methods:

  Concept: User
      To GetPermissions:
          Return "read"
  
  Situation: AdminMode
      Adjust User:
          To GetPermissions:
              Return "admin,write,delete"
  
  Story:
      Create User Called Bob
      Switch on AdminMode
      Print Bob.GetPermissions  # Now returns "admin,write,delete"
Objects change behavior based on active situations without mutating state. Is this useful or just overengineered?

What's NOT ready:

Performance is terrible (haven't optimized anything)

Standard lib is mostly TODOs

AI features are vaporware

REPL doesn't exist

No tooling (LSP, debugger, etc.)

Tests exist but coverage is poor

My questions:

Is context-oriented programming solving a real problem or creating busywork?

Should I focus on making it fast OR making the stdlib useful?

Is 1-based indexing a dealbreaker for you?

Would arbitrary precision by default bother you for a general-purpose language?

I'm not trying to replace anything. This is a learning project that got out of hand.

Repo: https://github.com/roriau0422/sfex-lang

Pages: https://roriau0422.github.io/sfex-lang/

Honest feedback wanted - including "this is pointless, stop wasting time."

Comments

nubg•2mo ago
this is pointless, stop wasting time.
nubg•2mo ago
just kidding of course, don't get discouraged by some random poster on the internet
keepamovin•2mo ago
This looks surprisingly fleshed out. Well done!
dunham•2mo ago
Congratulations on having a working language. You put a lot more effort into documentation than I have, but my language is just for me. (https://github.com/dunhamsteve/newt)

You might be interested in checking out Advent of Code (https://adventofcode.com/) to exercise your language. I had fun doing that with mine.

Also, there is a programming language development discord if that's your thing and you want to discuss your project with like-minded folks: https://discord.com/invite/4Kjt3ZE

> No tooling (LSP, debugger, etc.)

If you don't want to do a full LSP yet, you can get far with simple highlighting and scraping the output of the compiler for errors. I'm also dumping some additional information (top level names / types) as json to facilitate completion and type on hover.

> Is context-oriented programming solving a real problem or creating busywork?

Not sure. This kind of reminds me of dynamic scoping, something that seems to come up in languages that don't support. Go pushes contexts through as additional arguments, and Java thread local variables cover cases that look like dynamic scoping to me.

> Should I focus on making it fast OR making the stdlib useful?

I would go with whatever sounds fun and interesting to you. You'll probably want examples of what you want to make faster if you go with the former.

> Is 1-based indexing a dealbreaker for you?

Not a huge deal, but that was surprising to me in Lua. I adapted to it, but it did cause a little bit of awkwardness in some code I wrote that decoded a binary file format (realm database).

> Would arbitrary precision by default bother you for a general-purpose language?

I only glanced at it, but it looks like the user can choose IEEE if they want. It's nice to have options and few languages have this option.

roriau•2mo ago
Thanks — really appreciate you taking a look and sharing links.

Advent of Code is a great idea. I’ll try a few puzzles with SFX to exercise the stdlib and find awkward edges in the language and runtime.

Good call on the tooling approach. Emitting JSON for top-level names/types and scraping compiler errors sounds like a pragmatic first step before doing a full LSP. I’ll probably add that to the build output so editors can consume it easily.

I hadn’t thought to compare Situations to dynamic scoping/thread-locals that way — that’s a useful lens. My goal is to keep the behavior explicit enough that it doesn’t become mysterious, but your point about clarity is well taken; I’ll document the trade-offs more clearly.

1-based indexing has been a little surprising for folks (Lua vibes), and it does make some low-level tasks awkward. I’m keeping it because it simplifies some semantics, but I’ll watch for real usability problems and document where it trips people up.

About numbers — yes, FastNumber is available when you need IEEE performance. I want predictable defaults but not to lock users into one numeric model.

Thanks again for the pointers and the Discord link — I’ll check it out.

iroddis•2mo ago
Congrats on the progress thus far! I love aspirational languages, so please keep going.

That being said, as someone who struggles with maintaining large amounts of context when I’m debugging, I’d find context-specific execution hard to follow and debug. As a concrete example, the switch to an Admin context could appear far away from the call to GetPermissions without any obvious way to figure that out. Contexts end up being a sort of global state.

If you continue with this route, it would be nice if there was a way to print out the stack of the current contexts in play and where they were set in the code.

Are contexts scoped at all? Can they be layered?

roriau•2mo ago
You're correct if Context is hidden or implicit (like Dependency Injection containers or ThreadLocals in Java), it becomes debugging nightmare.

To solve this, SFX treats the Context Stack as Explicit Data, not hidden magic.

1. Debugging: Because the runtime knows exactly what 'Reality' is active, we can print it. We are building a `Context.Trace()` tool that outputs something like: `[Base Reality] -> [HolidaySale] -> [AdminMode]` This tells you exactly why a method is behaving the way it is.

2. Layering: Yes, contexts are strictly layered (LIFO stack). If you activate `Situation A` then `Situation B`, the runtime checks `B` first, then `A`, then the Object itself. This allows for 'Behavioral Inheritance'—you can compose behaviors (e.g., `LoggingMode` + `SafeMode`) dynamically.

3. Scoping: Right now it is imperative (`Switch on/off`), but because SFX is indentation-based, we are working on block-scoped contexts for the next release:

    Using AdminMode:
       User.Delete()  # Admin context
    # Automatically reverts here
    
Thanks for the encouragement.

Al Lowe on model trains, funny deaths and working with Disney

https://spillhistorie.no/2026/02/06/interview-with-sierra-veteran-al-lowe/
50•thelok•3h ago•6 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
117•AlexeyBrin•6h ago•20 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
811•klaussilveira•21h ago•246 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
49•vinhnx•4h ago•7 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
91•1vuio0pswjnm7•7h ago•102 comments

Reinforcement Learning from Human Feedback

https://rlhfbook.com/
72•onurkanbkrc•6h ago•5 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
1053•xnx•1d ago•601 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
471•theblazehen•2d ago•174 comments

U.S. Jobs Disappear at Fastest January Pace Since Great Recession

https://www.forbes.com/sites/mikestunson/2026/02/05/us-jobs-disappear-at-fastest-january-pace-sin...
49•alephnerd•1h ago•15 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
197•jesperordrup•11h ago•68 comments

Selection Rather Than Prediction

https://voratiq.com/blog/selection-rather-than-prediction/
8•languid-photic•3d ago•1 comments

Speed up responses with fast mode

https://code.claude.com/docs/en/fast-mode
9•surprisetalk•1h ago•2 comments

France's homegrown open source online office suite

https://github.com/suitenumerique
537•nar001•5h ago•248 comments

Coding agents have replaced every framework I used

https://blog.alaindichiappari.dev/p/software-engineering-is-back
205•alainrk•6h ago•312 comments

A Fresh Look at IBM 3270 Information Display System

https://www.rs-online.com/designspark/a-fresh-look-at-ibm-3270-information-display-system
33•rbanffy•4d ago•6 comments

72M Points of Interest

https://tech.marksblogg.com/overture-places-pois.html
26•marklit•5d ago•1 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
110•videotopia•4d ago•30 comments

Where did all the starships go?

https://www.datawrapper.de/blog/science-fiction-decline
69•speckx•4d ago•71 comments

Software factories and the agentic moment

https://factory.strongdm.ai/
63•mellosouls•4h ago•70 comments

Show HN: Kappal – CLI to Run Docker Compose YML on Kubernetes for Local Dev

https://github.com/sandys/kappal
21•sandGorgon•2d ago•11 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
271•isitcontent•21h ago•36 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
199•limoce•4d ago•110 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
284•dmpetrov•21h ago•153 comments

Making geo joins faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
155•matheusalmeida•2d ago•48 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
553•todsacerdoti•1d ago•267 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
424•ostacke•1d ago•110 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
467•lstoll•1d ago•308 comments

Ga68, a GNU Algol 68 Compiler

https://fosdem.org/2026/schedule/event/PEXRTN-ga68-intro/
41•matt_d•4d ago•16 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
348•eljojo•1d ago•214 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
367•vecti•23h ago•167 comments