frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I implemented generics in my programming language

https://axe-docs.pages.dev/features/generics/
25•death_eternal•4d ago
It took a while to implement, though now I have generic functions working in Axe. Documentation, repository and site attached.

Comments

p0w3n3d•1h ago
This are merely instanceof switches. Generics mean that you write

  fun(a,b): return a+b 
and if the a + b is doable, it will be done. You don't need to specify the list of types that accepts this syntax. The difference between this and duck typing is that you can also specify interfaces (or traits in c++) that will say that this type is quackable so

  fun(a <? implements Quackable>): a.quack()
is reusable. What is the difference between this and simple interface implementation? It took me some time to find this example in the narrowest version possible.

  class <T has trait Number> Complex(a T, b T):
    Complex<T> operator+(Complex<T> other): return new Complex(this.a + other.a, this.b+other.b)
    Complex<T> operator-(Complex<T> other): return new Complex(this.a - other.a, this.b-other.b)
    Complex<T> operator*(Complex<T> other):
       return Complex(this.a * other.a - this.b * other.b, this.a * other.b + this.b * other.a)
The generic renders this code reusable, so if only you can create a new type, let's say vector, that supports +,-, and multiply you can have complex algebra on those vectors
mrkeen•1h ago
You implemented Specifics.

One of my pet-hates is fellow developers who call an implementation 'generic', but when you peek inside, there's just if-statements that (at best) cover the already-known input types.

Usually I point to Generics as an example of what "generic" actually means: You peek inside List<T>, it doesn't know about your type, it does the right thing anyway.

one-punch•1h ago
You have implemented a form of ‘ad-hoc polymorphism’.

This is different from ‘parametric polymorphism’, which is what people call generics.

Someone•17m ago
I somewhat disagree. FTA: “If the callsite is some_function(2);, the compiler resolves T as i32 and selects the corresponding branch, returning the value incremented by one. […] The important point is that the decision is driven entirely by type information, not by runtime inspection”

Given that, this isn’t that different from C generics (https://en.cppreference.com/w/c/language/generic.html), and people call that generics, too.

Having said that, even ignoring that this requires all implementations to be in a single source file (yes, you probably could use m4 or #include or whatever it’s called in this language) I do not find this syntax elegant.

Also, one thing that it doesn’t seem to support is generating compiler errors when calling a function with a type that isn’t supported.

miellaby•1h ago
You should consider change the name, it looks like a lot like https://haxe.org/
Philip-J-Fry•29m ago
If your function changes it's behaviour based on the type, then it's not generic.

Your list_contains function should be able to just do a == comparison regardless of whether it's an int or a string.

This is effectively no different than adding a parameter to one of your non-"generic" functions and just swapping behaviour based on that?

Imustaskforhelp•25m ago
I saw your programming language on reddit and now here too. To me first looking at it, I think its built straight for parallelism, Didn't know you were on hackernews too, interesting stuff and I will try to keep an eye out hopefully for this language but what are some stuff where you think it can be really useful for?

Show HN: Stepped Actions – distributed workflow orchestration for Rails

https://github.com/envirobly/stepped
27•klevo•5d ago•4 comments

Show HN: UK Butchers Meat Price Tracker

https://offer-spider.onrender.com
9•wolfer•5d ago•1 comments

Show HN: I implemented generics in my programming language

https://axe-docs.pages.dev/features/generics/
25•death_eternal•4d ago•7 comments

Show HN: I open-sourced my Go and Next B2B SaaS Starter (deploy anywhere, MIT)

https://github.com/moasq/production-saas-starter
48•moh_quz•3h ago•27 comments

Show HN: Picknplace.js, an alternative to drag-and-drop

https://jgthms.com/picknplace.js/
359•bbx•2d ago•129 comments

Show HN: CommerceTXT – An open standard for AI shopping context (like llms.txt)

https://commercetxt.org/
14•tsazan•2d ago•11 comments

Show HN: Stop AI scrapers from hammering your self-hosted blog (using porn)

https://github.com/vivienhenz24/fuzzy-canary
293•misterchocolat•2d ago•212 comments

Show HN: We built a small app with my wife to track promises we do

https://lovechecks.app/
2•warkanlock•1h ago•0 comments

Show HN: Learning a Language Using Only Words You Know

https://simedw.com/2025/12/15/langseed/
68•simedw•4d ago•19 comments

Show HN: BlazeDiff v2 – Fastest image diff with native binary and SIMD

https://github.com/teimurjan/blazediff
4•teimurjan•1h ago•0 comments

Show HN: Agents.db – an AGENTS.md alternative for LLM agent context

https://github.com/krazyjakee/AGENTS.db
2•krazyjakee•4h ago•0 comments

Show HN: Composify – Open-Source Visual Editor / Server-Driven UI for React

https://github.com/composify-js/composify
65•injung•22h ago•5 comments

Show HN: Bithoven – A high-level, imperative language for Bitcoin Smart Contract

https://github.com/ChrisCho-H/bithoven
25•hyunhum•4d ago•8 comments

Show HN: Nano AI - Infinite Canvas AI Image Editor

https://nanoai.love/editor
3•akseli_ukkonen•5h ago•0 comments

Show HN: Xsql – SQL schema conversion via an intermediate representation (Rust)

https://github.com/Dawaman43/xsql
3•dawitworku•5h ago•0 comments

Show HN: Helix – AI-powered API mocking with strict schema enforcement

https://github.com/ashfromsky/helix
4•ashfromsky•6h ago•0 comments

Show HN: I built a fast RSS reader in Zig

https://github.com/superstarryeyes/hys
89•superstarryeyes•2d ago•31 comments

Show HN: Hacker News, but every headline is hysterical clickbait

https://dosaygo-studio.github.io/hn-front-page-2035/news-max.html
153•keepamovin•3h ago•65 comments

Show HN: Spice Cayenne – SQL acceleration built on Vortex

https://spice.ai/blog/introducing-spice-cayenne-data-accelerator
26•lukekim•19h ago•3 comments

Show HN: A local-first memory store for LLM agents (SQLite)

https://github.com/CaviraOSS/OpenMemory
47•nullure•5d ago•16 comments

Show HN: My own stolen JavaScript Server powered by Rust

https://shyam20001.github.io/rsjs/
4•StellaMary•7h ago•0 comments

Show HN: Paper2Any – Open tool to generate editable PPTs from research papers

https://github.com/OpenDCAI/DataFlow-Agent
11•Mey0320•21h ago•2 comments

Show HN: High-Performance Wavelet Matrix for Python, Implemented in Rust

https://pypi.org/project/wavelet-matrix/
90•math-hiyoko•1d ago•10 comments

Show HN: Sqlit – A lazygit-style TUI for SQL databases

https://github.com/Maxteabag/sqlit
180•MaxTeabag•3d ago•40 comments

Show HN: TinyPDF – 3KB PDF library (70x smaller than jsPDF)

https://github.com/Lulzx/tinypdf
15•lulzx•19h ago•3 comments

Show HN: MephistoMail – RAM-only ephemeral email with client-side privacy tools

https://www.mephistomail.site/
3•benmxrt•10h ago•0 comments

Show HN: WebCraft: A C++ 23 async IO library

2•raoa32•11h ago•0 comments

Show HN: Daily Set Puzzle – I rebuilt it after setgame.com's SSL cert expired

https://www.anniehu.com/set/
7•anniegracehu•11h ago•2 comments

Show HN: DocsRouter – The OpenRouter for OCR and Vision Models

https://docsrouter.com
10•misbahsy•1d ago•0 comments

Show HN: Postman-style TUI for API testing built with Rust and ratatui

https://github.com/pranav-cs-1/nexus
3•PranavVyas•13h ago•0 comments