Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Can all you Lisp Weezards explain to me

Name: Anonymous 2016-09-11 9:11

Why Lisp macros supposedly don't play well with static types? I.e. what hinders a statically-typed Lisp?
As I see it, macros operate on ASTs and type declarations are just another parts of AST so there should be no inherent problems there.

Thank you.

Name: Anonymous 2016-09-11 15:08

Why Lisp macros supposedly don't play well with static types?
Why?

I.e. what hinders a statically-typed Lisp?
Nothing.

As I see it, macros operate on ASTs and type declarations are just another parts of AST so there should be no inherent problems there.
Your vision is correct.

Name: Anonymous 2016-09-11 15:23

One word: https://github.com/LuxLang/lux

Types

They are implemented as plain-old data-structures whose expressions get eval'ed by the compiler and integrated into the type-checker. That means it's actually possible to generate types via functions. However, most of the types in the prelude are generated via several macros that provide a more pleasant syntax to types.

If you wonder what types look like without makeup, feel free to read the first few hundred lines of lux.lux.

Name: Anonymous 2016-09-11 15:45

Typed Racket
/thread

Name: Anonymous 2016-09-11 16:09

>>4
YOU MENA )

Name: Anonymous 2016-09-11 17:51

Why Lisp macros supposedly don't play well with static types? I.e. what hinders a statically-typed Lisp?

If you want you could do it template haskell style. macros are just functions AST -> AST. There's no way to ensure that expanded code will be well typed though.

If we want that then it gets difficult: think about a standard type system. Just looking at a piece of code you can statically infer or validate a type (without running the code).

so for a typed macro system we would want the same property.
* (A) A piece of code that involves macro uses would be able to be statically checked, therefore we need to be able to look up the macro name and what resulting type it'll have based on its input types.
* (B) macro definitions need to be checked over and assigned a type transformation rule

(B) is the hard part. If you annotate the macro definitions with types I don't see why it couldn't be done though.

Name: Anonymous 2016-09-11 17:53

it would be a lot simpler to only have standard types like strings and numbers without the ability to create "new types" aka OOP. you get all the compiler optimization without the bullshit.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List