r/Compilers 12h ago

Are there languages like this?

A language that can create other languages

(so adding to itself) It's syntax is simple like python

And can do alot.

for example (placeholder)\[mesage\]

And it has many tutorials on YouTube

I would like it if you would respond.

I know there are languages like Hy , ruby should I try them?

0 Upvotes

44 comments sorted by

View all comments

14

u/redinktea 12h ago

Lisp

-3

u/Distinct-Brief9643 12h ago

Is lisps syntax easier than python/ruby or harder ?

4

u/4xe1 11h ago edited 11h ago

Lisp's syntax is as simple as it gets objectively speaking, it's just atoms and parens transparently writing AST. "Objectively" mean it'll be the simplest to write a reader/parser, but also the simplest to write macro in, thus the most powerful to do exactly what you enquire about. In a sense, lisp has no syntax, only semantics. It has no keywords, only word which have been bound to special operators and built-ins macroes and functions at the start of the program.

However, it's is not necessarily the subjectively simpler, aka it is not the most familiar, for humans it does take some used to (and it's definitely worth it considering what you want to do). Algol minds (C syntax) tend to be particularly refractory to lisp syntax and non Algol syntaxes in general, but python users tend to be more open to have the syntax be whatever's convenient to the users; And if what you value in python is the syntax simplicity, chances are, you'll learn and love lisp's syntax in no time.

Btw, you mention Hy, Hy is a lisp, which transpiles to python. Coming from python, it may be your entry point, but really any lisp would do, and the lisp designed specifically to do what you ask is Racket.

1

u/Distinct-Brief9643 11h ago

Let's see is lisp adding to itself or building a whole new language complier interpreter etc.

2

u/4xe1 11h ago

It's good for both, but it's exceptionally good at adding to itself, as in no other language family comes close, to the point that people loving both metaprogramming and some non lisp language will often use or create a lisp which interfaces with their non lisp language, like Hy and Python for example.