Re: Static/Strong/Implicit Typing
From: sajiimori (myusername_at_hotmail.com)
Date: 01/27/04
- Next message: Kenny Tilton: "Re: Length of Lisp programs"
- Previous message: Kenny Tilton: "Re: Static/Strong/Implicit Typing"
- In reply to: Gareth McCaughan: "Re: Static/Strong/Implicit Typing"
- Next in thread: Rahul Jain: "Re: Static/Strong/Implicit Typing"
- Reply: Rahul Jain: "Re: Static/Strong/Implicit Typing"
- Reply: Pascal Costanza: "Re: Static/Strong/Implicit Typing"
- Reply: Gareth McCaughan: "Re: Static/Strong/Implicit Typing"
- Reply: Erik Naggum: "Re: Static/Strong/Implicit Typing"
- Reply: Joe Marshall: "Re: Static/Strong/Implicit Typing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Jan 2004 03:37:06 GMT
> Then I can't use the sequence functions of Common Lisp that
> accept both lists and vectors. I can't use the nice flexible
> arithmetic functions.
You could if the functions had multiple versions, and the compiler inserted
calls to the appropriate ones (since it has all the static type information
it needs to make that determination).
> Next: I can't write macros any more. To define a macro,
> you define a function that operates on source code.
> And embedded in that source code there may be all kinds
> of objects. Numbers of various kinds, symbols, cons cells
> (for code or data), arrays, strings, blah, blah, blah.
> This is not a situation that static type systems tend
> to handle well.
That is very important. I wonder why nobody else had mentioned it (that I
saw anyway)?
> Suppose we define a discriminated union
> type that can contain anything that can appear literally
> in source code, and then build our representation of code
> out of that.
This is what I was thinking.
> (It would probably be necessary to forbid
> user-defined types appearing here, but maybe that's not
> so terrible.)
Don't user-defined types have to be based on built-in types anyway?
> Next: I can't have arbitrary-length inhomogeneous lists
> any more.
I don't see the problem with allowing arbitrary length, but having to use
homogeneous lists... yeah, that could be inconvenient. Trying to re-add
them would just make the language more complicated (like Java).
> Next: I can't do exploratory programming so well any more.
> I can't take my running web server program and decide that
> I need such-and-such a function to accept strings as well
> as symbols, type in a new definition of that function,
> and have everything just go on working.
Right.
> Next: I have trouble imagining how CLOS is going to carry
> on working.
It won't. Next! ;-)
> Does someone have
> a design for a statically typed Lisp that wouldn't feel
> really un-Lispy to work with? For instance, do you?
Nope, just been toying with the idea.
> Erik Naggum observed that you can *already* consider CL
> to be strongly, statically, implicitly typed, with everything
> having type T.
Still sounds like a joke. Implementing such a type system requires exactly
0 lines of code. Its requirements are necessarily met. It's like a type
system that requires that objects are not of negative size.
> So if you want to ask questions
> about a "statically typed Lisp" then you ought to be more
> specific about just how fine-grained you want that partition
> to be, and why.
Akin to Haskell. And...umm...because I feel like it? =)
- Next message: Kenny Tilton: "Re: Length of Lisp programs"
- Previous message: Kenny Tilton: "Re: Static/Strong/Implicit Typing"
- In reply to: Gareth McCaughan: "Re: Static/Strong/Implicit Typing"
- Next in thread: Rahul Jain: "Re: Static/Strong/Implicit Typing"
- Reply: Rahul Jain: "Re: Static/Strong/Implicit Typing"
- Reply: Pascal Costanza: "Re: Static/Strong/Implicit Typing"
- Reply: Gareth McCaughan: "Re: Static/Strong/Implicit Typing"
- Reply: Erik Naggum: "Re: Static/Strong/Implicit Typing"
- Reply: Joe Marshall: "Re: Static/Strong/Implicit Typing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|