Ask HN: What metaprogrammable language do you/would like to use?
31–40 of 76 posts
Re: Ask HN: What metaprogrammable language do you/would like to use?
#32I 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'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?
#33Re: Ask HN: What metaprogrammable language do you/would like to use?
#34Re: Ask HN: What metaprogrammable language do you/would like to use?
#35I 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 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?
#36I 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…
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?
#37what 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?
#38https://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?
#39Earlier 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".
Re: Ask HN: What metaprogrammable language do you/would like to use?
#40I know its hated passionately, but I learned about metaprogramming from it.
Also, imo, Racket is the best language for metaprogramming.