News for hackers. Stuff that matters.
Re:V Programming Language released by gingerBill on Thursday June 20, 2019 @07:40AM (#20231809)
That is not what I stated in the issue.

For the kind of features that you wanted in your language, not just generics, requires a form of AST (abstract syntax tree), and if you language does not have an AST, which is technically possible, then you cannot have a lot of the features you have been advertising.

Re:V Programming Language released by lifthrasiir on Thursday June 20, 2019 @07:46AM (#20231856)
I should stress that that is also your misconception. For example, you can implement generics without an AST if you don't care about performance; codegen can either output a single binary mandatorily requiring a sort of vtable (therefore every parametric code will be indirected), or output a partial binary with holes where holes will be patched later (much faster but disallows optimization across hole boundaries).

You should have framed your question as follows: those features can be implemented without an AST, but an AST is a standard and reasonable way to do them and not using an AST would require a strong rationale. So what's that rationale? (And amedvednikov, this is my question for you.)

Re:V Programming Language released by amedvednikov on Thursday June 20, 2019 @08:31AM (#20232183)
No you don't understand :) It's IMPOSSIBLE without AST. The Odin creator says so. That's why I'm a liar.

V simply generates functions for every type they're used with.

Re:V Programming Language released by lifthrasiir on Thursday June 20, 2019 @08:41AM (#20232260)
> V simply generates functions for every type it's used with.

So you have a "template" function as written in the source code and a list of actual functions generated. You can either generate them as a final step or on the fly as you encounter; in either ways you probably have a mapping from the function name to the function body or something similar. How is that stored?