guitarvydas
03/16/2025, 3:43 AMKonrad Hinsen
03/16/2025, 8:23 AMguitarvydas
03/16/2025, 9:17 AMJack Rusher
03/16/2025, 2:39 PMGuyren Howe
03/16/2025, 9:59 PMJack Rusher
03/17/2025, 11:50 AMJack Rusher
03/17/2025, 11:54 AMguitarvydas
03/17/2025, 2:45 PMeval really treats "data as code", not "code as data".
"syntax is a view"[Points that jumped out at me from the blog article that @Konrad Hinsen mentioned]
guitarvydas
03/18/2025, 1:25 AMguitarvydas
03/18/2025, 1:27 AMGuyren Howe
03/18/2025, 1:29 AMhas_one :user
has_many :logins
has_and_belongs_to_Many :account_groups
validates :user, presence: true
It’s nice when without much fuss, your language naturally supports expressing declarative truths in your program with close to optimal concision.Jack Rusher
03/18/2025, 7:06 AMKonrad Hinsen
03/18/2025, 8:25 AMguitarvydas
03/18/2025, 12:19 PMguitarvydas
03/18/2025, 12:24 PMJack Rusher
03/18/2025, 12:43 PMKonrad Hinsen
03/18/2025, 12:50 PMMisha A
04/18/2025, 6:50 PMThe goal should be to produce notations so concise that whole programs fit in one eye-full,yes. Maybe not entire programs, because of non-reducible amount of states in non-trivial programs, but yes.
"syntax is a view"yes
I express this belief mostly by creating s-expression-based SCNs in Lisp.yes. Not that many 'usual' text-based things are hard to cram into s-expressions. Trivial things are expressible with no extra work, but few extra parens. Larger but manageable things can be just string arg (that racket-algol example, or infamous SQL strings). But there is always just "flat s-expr with hundred args" approach, especially when you can express DSL's literal tokens in your fav LISP's literals: chars, strings, symbols, numbers, bools, keywords, vecs, lists, maps, sets. For example, clojure's
(let [a 1] a)
is a DSL too, since in the rest of the language same level tokens have independent scope: in (+ x y)
- y
does not have x
in scope.
But replace +
with let
and x
with bindings vector, and suddenly y
has in scope whatever is on the left:
(+ x y)
-> (let bindings y)
-> (let [y 1] y)
(ofc every macro is a DSL).
I guess my point is you can ride s-expr macros pretty far even without reaching for multiple compilers, especially if DSLs are tiny.
re: IDE support - this seems relevant: https://www.jetbrains.com/help/idea/using-language-injections.html#language_annotation