frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Ask HN: Is GitHub Down?

8•AznHisoka•42m ago•4 comments

Tell HN: Bending Spoons laid off almost everybody at Vimeo yesterday

405•Daemon404•22h ago•464 comments

Tell HN: 2 years building a kids audio app as a solo dev – lessons learned

130•oliverjanssen•1d ago•69 comments

Ask HN: Why are so many rolling out their own AI/LLM agent sandboxing solution?

21•ATechGuy•1d ago•9 comments

Ask HN: Do you have any evidence that agentic coding works?

425•terabytest•2d ago•428 comments

Ask HN: Does "Zapier for payment automation" exist?

8•PL_Venard•1d ago•12 comments

Ask HN: How are you automating your coding work?

72•manthangupta109•19h ago•78 comments

Tell HN: Claude session limits getting small

20•pragmaticalien8•21h ago•14 comments

Ask HN: Does Apple not have *any* QA for their older macOS releases?

3•richrichardsson•5h ago•0 comments

Ask HN: COBOL devs, how are AI coding affecting your work?

167•zkid18•3d ago•183 comments

Users don't care about your app's complexity

5•Fh_•6h ago•6 comments

Ask HN: Revive a mostly dead Discord server

19•movedx•1d ago•28 comments

Ask HN: How do you run parallel agent sessions?

7•Olshansky•2d ago•2 comments

Ask HN: What have you built/shipped with Claude Code?

9•blhack•1d ago•4 comments

Ask HN: How did Gemini go from being awful to incredible back to awful?

4•wewewedxfgdf•10h ago•5 comments

How do you keep AI-generated applications consistent as they evolve over time?

9•RobertSerber•21h ago•0 comments

Ask HN: What are good resources to get familiar with AI code editors?

8•northfield27•1d ago•6 comments

Tell HN: Avoid Cerebras if you are a founder

29•remusomega•22h ago•15 comments

Ask HN: Vibe-coded prototypes: what happens when they go into production?

5•stosssik•14h ago•1 comments

Tell HN: Claude helped me maintain my old open source project

12•nergal•18h ago•7 comments

Ask HN: How locked down are your work machines?

15•donatj•19h ago•20 comments

Ask HN: Do you protect your client-side JavaScript? Why or why not?

5•nikitaeverywher•1d ago•1 comments

Tell HN: Amazon has deactivated my seller account

74•hacky_engineer•20h ago•72 comments

Ask HN: Which common map projections make Greenland look smaller?

18•jimnotgym•1d ago•17 comments

Experimenting with a Compiled Language

3•JhonPork•9h ago•5 comments

Do people at Google use Gmail?

3•mr-pink•9h ago•1 comments

Ask HN: Are you going to meetups/conferences?

9•carimura•23h ago•7 comments

Ask HN: Why does SOC 2 feel so hard for early-stage startups?

7•asdxrfx•1d ago•3 comments

Ask HN: How do you audit autonomous AI agent decisions?

3•credentum•13h ago•2 comments

Ask HN: How do you keep system context from rotting over time?

15•kennethops•1d ago•21 comments
Open in hackernews

Experimenting with a Compiled Language

3•JhonPork•9h ago
I’ve been experimenting with a compiled language design and wanted feedback from people who’ve worked on compilers or systems code.

The core idea is allowing multiple execution profiles to coexist in a single source file:

- userland (default): indentation-based, Python-like syntax, safety by default - kernel: brace-based syntax, strict rules, no heap or runtime - baremetal: brace-based syntax, raw pointers, no safety net

At build time, a single profile is selected and all other code is erased at compile time — no runtime checks or overhead.

The compiler pipeline is lexer → parser → typed IR → LLVM backend, with profile rules enforced during IR validation rather than at runtime.

Roughly ~90% of the core language and compiler are implemented; I plan to open-source the project once the remaining pieces are finished.

This is still an experiment. I’m mainly curious: - does this model make sense? - are there obvious design pitfalls? - has anyone seen similar approaches succeed or fail?

I’d appreciate critical feedback.

Comments

platinumrad•7h ago
> At build time, a single profile is selected and all other code is erased at compile time — no runtime checks or overhead.

Can you expand on this?

JhonPork•6h ago
Profiles are resolved before code generation, not via conditionals. Each top-level item (function, block, impl, import) can be annotated with a profile (userland, kernel, baremetal). During parsing, everything is collected into the AST as usual. During IR lowering, the compiler is invoked with exactly one active profile. At that point: Nodes whose profile does not match are not lowered to IR at all They are dropped during IR validation, not guarded or compiled The resulting IR literally has no trace of the other profiles So this is not like #ifdef or runtime flags. The non-selected code never reaches: borrow checking optimization codegen linking From LLVM’s point of view, it’s as if the other code never existed. That’s why there’s no runtime overhead: no branches, no checks, no dead code elimination required. The IR is profile-pure by construction. This also lets the compiler enforce different rules per profile: userland: heap allowed, panics allowed kernel: no heap, no panic, stricter aliasing baremetal: raw pointers, UB allowed Invalid combinations simply fail IR validation. Happy to clarify further once the repo is public.
platinumrad•6h ago
Code that is #ifdef'd out doesn't even make it into the AST so traces of it aren't going to be found in the IR either.

I think I'm missing something really basic. The idea of three different subsets/dialects is interesting, but I would expect all three to be usable at the same time, like how unsafe blocks can be used in the performance-critical sections of a larger Rust program.

JhonPork•5h ago
Good question the distinction is intentional.

Falcon’s profiles are not meant to be “dialects you mix freely” like Rust’s unsafe blocks. They represent different execution contracts, not different safety levels inside the same runtime.

In Rust, unsafe still lives inside one program with:

- one allocator - one runtime model - one ABI - one set of linking assumptions

In Falcon, each profile defines a different world:

- userland assumes a runtime: heap, panics, rich abstractions - kernel assumes no runtime: no heap, no panics, stricter aliasing - baremetal assumes no OS at all: raw pointers, direct memory, UB allowed

Mixing them at runtime would force the strongest constraints everywhere, or require dynamic checks — which defeats the goal.

Instead, Falcon treats profiles as compile-time execution modes, not scoped escape hatches.

The reason non-selected profiles are erased before IR is so:

- LLVM never sees incompatible assumptions - no dead-code elimination or guards are needed - profile-specific rules can be enforced structurally, not heuristically

You still share logic by compiling the same source multiple times:

    falcon build app.fc --profile=userland
    falcon build app.fc --profile=kernel
    falcon build app.fc --profile=baremetal
Or:

    falcon build app.fc --profiles=all
This produces multiple artifacts from one codebase, each valid by construction for its environment.

So the comparison isn’t “why not Rust unsafe blocks”, but: “Should fundamentally different execution contracts coexist at runtime, or be selected at compile time?”

Falcon chooses the latter to avoid hidden coupling and runtime cost.

forgotpwd16•2h ago
Unusual concept. Will split my thoughts on implementation and adoption (in regards to design).

Implementation-wise: Tried myself something similar. One language (same core & lib & built-ins) with 2 front-ends that had different syntax and, but similar, semantics. (Didn't go far though.) An issue is not favoring one over the other. Inevitably, in a meta way, you'll if decide to self-host since will've to pick one form to do it. Also, having multiple co-existing forms in same file may complicate tooling.

About the last part, most similar things I've seen are: (i) Perl Mojo's embedded templates which can be included in same file with source code, (ii) Racket's #lang multi-file which allows combining, well, multiple files (thus also use different #lang directives) in same file.

Adoption-wise: It's in a weird position for widespread adoption. There's strong preference towards using a single language which splits into 2 branches: (1) using single language across every layer (basically Rust/Zig), (2) using high-level language with native-competive performance (Python+numpy, jax, etc / JS+ultrafast JIT / Julia).

Currently you target both (one base language) and none (different syntax/semantics). Could move towards an hybrid approach instead by having one syntax and high-level / low-level forms (uncertain what distinguishes kernel/baremetal currently). So some functionality may end up showing differently in the 2 cases to be more acceptable by both camps. This will probably also simplify tooling creation/maintenance.

Of course, since the project is quite experimental in nature, keeping it current way is interesting and very acceptable.

TL;DR Yes (~templating) - Yes (complexity, lower potential adoption) - No (unusual, experimental)