Live data from Hacker News

Ask HN: What metaprogrammable language do you/would like to use?

news.ycombinator.com

31–40 of 76 posts

Re: Ask HN: What metaprogrammable language do you/would like to use?

#32
post #13

I just add "Julia" for this list; Ideal for Scientific computing. ( LLVM based; Optionally typed; Dynamic ) https://julialang.org/ https://docs.julialang.org/en/v1/index.html Julia Metaprogramming: https://docs.julialang.org/en/v1/manual/metaprogramming/inde... Julia: "Building a Language and Compiler for Machine Learning" ( compiling to GPU; TPU ) https://julialang.org/blog/2018/12/ml-language-compiler "Why Does Jul…

I'd like to say I'm a huge fan of Julia, and don't have much experience with metaprogramming in other languages.

I'm sure I do more of this than necessary, but much of my code ends up being "generated functions".

@generated foo(x, y) ... end

When you write an `@generated` function, you write code that creates a Julia expression. Using "x" and "y" in the function give you the types of these arguments. Defining parametric structs lets you pass any information you want (eg, array sizes) to specialize code and algorithms.

A very useful library: https://github.com/MikeInnes/MacroTools.jl

Re: Ask HN: What metaprogrammable language do you/would like to use?

#35
post #13

I just add "Julia" for this list; Ideal for Scientific computing. ( LLVM based; Optionally typed; Dynamic ) https://julialang.org/ https://docs.julialang.org/en/v1/index.html Julia Metaprogramming: https://docs.julialang.org/en/v1/manual/metaprogramming/inde... Julia: "Building a Language and Compiler for Machine Learning" ( compiling to GPU; TPU ) https://julialang.org/blog/2018/12/ml-language-compiler "Why Does Jul…

I came here to say Julia as well!

I didn’t really understand or get the point of metaprogramming, but the more Julia I’ve been writing the more I’ve seen fantastic uses of it and the more inspired I get.

Plus the language itself is a real pleasure to write.

Re: Ask HN: What metaprogrammable language do you/would like to use?

#36
post #32
post #13

I just add "Julia" for this list; Ideal for Scientific computing. ( LLVM based; Optionally typed; Dynamic ) https://julialang.org/ https://docs.julialang.org/en/v1/index.html Julia Metaprogramming: https://docs.julialang.org/en/v1/manual/metaprogramming/inde... Julia: "Building a Language and Compiler for Machine Learning" ( compiling to GPU; TPU ) https://julialang.org/blog/2018/12/ml-language-compiler "Why Does Jul…

I'd like to say I'm a huge fan of Julia, and don't have much experience with metaprogramming in other languages. I'm sure I do more of this than necessary, but much of my code ends up being "generated functions". @generated foo(x, y) ... end When you write an `@generated` function, you write code that creates a Julia expression. Using "x" and "y" in the function give you the types of these arguments. Defining paramet…

Mike Innes produces so many cool Julia libraries!

Flux is easily the coolest ML framework I’ve used, and I’ve just discovered Lazy.jl.

Re: Ask HN: What metaprogrammable language do you/would like to use?

#37
> Ruby is notably absent as I use it and am looking for something better/different

what issues do you have with ruby? it's the de-facto standard for meta-programming

I often use things like `define_method`, `constants`, `method_missing`, etc in select places.

last fun thing I did was adding `let` and `it` to rails's tests.

Re: Ask HN: What metaprogrammable language do you/would like to use?

#38
It's worth to mention Factor programming language - https://factorcode.org/

https://en.wikipedia.org/wiki/Factor_(programming_language)

https://github.com/factor/factor/

http://andreaferretti.github.io/factor-tutorial/ - Good introduction and Metaprogramming section.

Re: Ask HN: What metaprogrammable language do you/would like to use?

#39

Earlier quoted context omitted.

Compile-time MP and run-time MP. Support for AST and quasi-quote MP, and support for LMS (= lightweight modular staging).

You haven't seen any Lisp yet, have you? Compile and run-time MP and quasiquoting are basic features; I'd argue that a language without these doesn't even qualify as "supporting metaprogramming".

Sure, I'm intimately familiar with the Lisp family of languages. It lacks features that I prefer in a modern meta-programming language, in particular an expressive typing system with type inference, and a platform / eco-system like the JVM.
Post reply on HN