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•1h 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•51m ago
this is pointless, stop wasting time.
nubg•51m ago
just kidding of course, don't get discouraged by some random poster on the internet
keepamovin•40m ago
This looks surprisingly fleshed out. Well done!
dunham•16m 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•3m 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.

Tiny Core Linux: a 23 MB Linux distro with graphical desktop

http://www.tinycorelinux.net/
211•LorenDB•4h ago•106 comments

GrapheneOS is the only Android OS providing full security patches

https://grapheneos.social/@GrapheneOS/115647408229616018
189•akyuu•5h ago•49 comments

Z-Image: Powerful and highly efficient image generation model with 6B parameters

https://github.com/Tongyi-MAI/Z-Image
75•doener•6d ago•27 comments

Perl's decline was cultural

https://www.beatworm.co.uk/blog/computers/perls-decline-was-cultural-not-technical
84•todsacerdoti•1h ago•77 comments

HTML as an Accessible Format for Papers

https://info.arxiv.org/about/accessible_HTML.html
111•el3ctron•4h ago•67 comments

Touching the Elephant – TPUs

https://considerthebulldog.com/tte-tpu/
86•giuliomagnifico•6h ago•26 comments

Autism's confusing cousins

https://www.psychiatrymargins.com/p/autisms-confusing-cousins
115•Anon84•7h ago•119 comments

Linux Instal Fest Belgrade

https://dmz.rs/lif2025_en
109•ubavic•8h ago•14 comments

The unexpected effectiveness of one-shot decompilation with Claude

https://blog.chrislewis.au/the-unexpected-effectiveness-of-one-shot-decompilation-with-claude/
108•knackers•1w ago•52 comments

Infisical (YC W23) Is Hiring Engineers to Build the Modern OSS Security Stack

https://www.ycombinator.com/companies/infisical/jobs/2pwGcK9-senior-full-stack-engineer-us-canada
1•vmatsiiako•1h ago

A compact camera built using an optical mouse

https://petapixel.com/2025/11/13/this-guy-built-a-compact-camera-using-an-optical-mouse/
202•PaulHoule•3d ago•37 comments

Mapping Amazing: Bee Maps

https://maphappenings.com/2025/11/06/bee-maps/
31•altilunium•6d ago•18 comments

Detecting AV1-encoded videos with Python

https://alexwlchan.net/2025/detecting-av1-videos/
10•surprisetalk•4d ago•2 comments

How I discovered a hidden microphone on a Chinese NanoKVM

https://telefoncek.si/2025/02/2025-02-10-hidden-microphone-on-nanokvm/
230•ementally•5h ago•60 comments

Kids who ran away to 1960s San Francisco

https://www.fieldnotes.nautilus.quest/p/the-kids-who-ran-away-to-1960s-san
81•zackoverflow•4d ago•7 comments

Self-hosting my photos with Immich

https://michael.stapelberg.ch/posts/2025-11-29-self-hosting-photos-with-immich/
555•birdculture•6d ago•320 comments

Cloudflare outage on December 5, 2025

https://blog.cloudflare.com/5-december-2025-outage/
733•meetpateltech•1d ago•538 comments

Finding Gene Cernan's Missing Moon Camera

https://www.spacecamera.co/articles/2020/3/3/gene-cernans-missing-lunar-surface-camera
5•theodorespeaks•3d ago•0 comments

The Absent Silence (2010)

https://www.ursulakleguin.com/blog/3-the-absent-silence
62•dcminter•4d ago•17 comments

Gemini 3 Pro: the frontier of vision AI

https://blog.google/technology/developers/gemini-3-pro-vision/
523•xnx•1d ago•267 comments

Netflix to Acquire Warner Bros

https://about.netflix.com/en/news/netflix-to-acquire-warner-bros
1645•meetpateltech•1d ago•1251 comments

PalmOS on FisherPrice Pixter Toy

https://dmitry.gr/?r=05.Projects&proj=27.%20rePalm#pixter
159•dmitrygr•15h ago•24 comments

Schizophrenia sufferer mistakes smart fridge ad for psychotic episode

https://old.reddit.com/r/LegalAdviceUK/comments/1pc7999/my_schizophrenic_sister_hospitalised_hers...
394•hliyan•11h ago•353 comments

Making tiny 0.1cc two stroke engine from scratch

https://youtu.be/nKVq9u52A-c?si=KVY6AK7tsudqnbJN
123•pillars•6d ago•31 comments

Divine D native Linux open-source mobile system – Rev. 1.1 Hardware Architecture

https://docs.dawndrums.tn/blog/dd-rev1.1-arch/
43•wicket•4d ago•8 comments

Netflix’s AV1 Journey: From Android to TVs and Beyond

https://netflixtechblog.com/av1-now-powering-30-of-netflix-streaming-02f592242d80
523•CharlesW•1d ago•266 comments

Wolfram Compute Services

https://writings.stephenwolfram.com/2025/12/instant-supercompute-launching-wolfram-compute-services/
206•nsoonhui•11h ago•108 comments

Leaving Intel

https://www.brendangregg.com/blog//2025-12-05/leaving-intel.html
312•speckx•21h ago•182 comments

Have I been Flocked? – Check if your license plate is being watched

https://haveibeenflocked.com/
273•pkaeding•15h ago•189 comments

Frinkiac – 3M "The Simpsons" Screencaps

https://frinkiac.com/
145•GlumWoodpecker•3d ago•48 comments