BLisp: A Statically Typed Lisp Like Language
ytakano.github.io
BLisp: A Statically Typed Lisp Like Language
1–10 of 51 posts
Re: BLisp: A Statically Typed Lisp Like Language
#2Also, is there an example of the type inference working?
Re: BLisp: A Statically Typed Lisp Like Language
#3For statically typed languages, they only feel ergonomic to me if they have highly specialized syntax and if they really leverage the type-system (which is often in conflict with macros and runtime flexibility).
Re: BLisp: A Statically Typed Lisp Like Language
#4I always feel that for lisp-like languages it's just not a good idea to make them statically typed. Their power is derived from macros and the fact that code is data and the other way around. For statically typed languages, they only feel ergonomic to me if they have highly specialized syntax and if they really leverage the type-system (which is often in conflict with macros and runtime flexibility).
Re: BLisp: A Statically Typed Lisp Like Language
#5I always feel that for lisp-like languages it's just not a good idea to make them statically typed. Their power is derived from macros and the fact that code is data and the other way around. For statically typed languages, they only feel ergonomic to me if they have highly specialized syntax and if they really leverage the type-system (which is often in conflict with macros and runtime flexibility).
Re: BLisp: A Statically Typed Lisp Like Language
#6I always feel that for lisp-like languages it's just not a good idea to make them statically typed. Their power is derived from macros and the fact that code is data and the other way around. For statically typed languages, they only feel ergonomic to me if they have highly specialized syntax and if they really leverage the type-system (which is often in conflict with macros and runtime flexibility).
I completely agree with the idea that their power is derived from macros, but I vehemently disagree that macros are incompatible with a static type system. The type of a form can be just a simple ADT
data Form = FInt Int
| FCons Form Form
| FNil
| FString String
| ...
and a macro is just a function taking Form as arguments and returning a Form. With standard HM type inference, your macros can look exactly like they do in a dynamically typed Lisp. If the backquote is just a reader macro that produces a Form: (defmacro double (x)
`(* x x))
that would be expanded into (defmacro double (x)
(FCons '* (FCons x (FCons x FNil))))
and type inference would determine that the type of double is double :: Form -> Form
And destructuring Forms is just normal ADT pattern matching.Re: BLisp: A Statically Typed Lisp Like Language
#7Re: BLisp: A Statically Typed Lisp Like Language
#8I always feel that for lisp-like languages it's just not a good idea to make them statically typed. Their power is derived from macros and the fact that code is data and the other way around. For statically typed languages, they only feel ergonomic to me if they have highly specialized syntax and if they really leverage the type-system (which is often in conflict with macros and runtime flexibility).
> I always feel that for lisp-like languages it's just not a good idea to make them statically typed. Their power is derived from macros and the fact that code is data and the other way around. I completely agree with the idea that their power is derived from macros, but I vehemently disagree that macros are incompatible with a static type system. The type of a form can be just a simple ADT data Form = FInt Int | FCo…
Why would it not just be a normal function then?
Re: BLisp: A Statically Typed Lisp Like Language
#9Earlier quoted context omitted.
> I always feel that for lisp-like languages it's just not a good idea to make them statically typed. Their power is derived from macros and the fact that code is data and the other way around. I completely agree with the idea that their power is derived from macros, but I vehemently disagree that macros are incompatible with a static type system. The type of a form can be just a simple ADT data Form = FInt Int | FCo…
> and a macro is just a function taking Form as arguments and returning a Form Why would it not just be a normal function then?
Re: BLisp: A Statically Typed Lisp Like Language
#10I always feel that for lisp-like languages it's just not a good idea to make them statically typed. Their power is derived from macros and the fact that code is data and the other way around. For statically typed languages, they only feel ergonomic to me if they have highly specialized syntax and if they really leverage the type-system (which is often in conflict with macros and runtime flexibility).
Seems like you could still have macros, they would just evaluate before type checking. Rust works this way
EDIT: here's an example of a discussion about that in Rust: https://github.com/rust-lang/unsafe-code-guidelines/issues/2...