What feature would you most like to see in Lisp?

Whatever is on your mind, whether Lisp related or not.
Jasper
Posts: 209
Joined: Fri Oct 10, 2008 8:22 am
Location: Eindhoven, The Netherlands
Contact:

Re: What feature would you most like to see in Lisp?

Post by Jasper » Tue Feb 24, 2009 12:48 pm

MrSelfDefstruct wrote:def for definition, fn is lambda, (+ _ 4) is (lambda (x) (+ x 4))
This one isn't lispy, the first symbol in a list must determine the function/macro, unless it is interpreted by a macro, and then what is lispy gets blurrier. I think better versions of what you mean are discussed here.

As for lisp-1 i personally prefer different namespaces for functions and variables. Maybe you should blame quantummechanics :p
<x|X = x<x|, Integral(x over space, |x><x|)=1 (x is variable x, |x>,<x| is state and X is position operator. Jokes aside, it seems really arbitrary which too choose. Anyone know something to make it less arbitrary?

As for features i desire, i have a project; lang-lisp(I still have to improve the explanation on that website); with which i plan to create them. Here some of them are:

Better types, ones that allow for having different types, like C++'s templates. Functions that are overloaded using that. Types that are 'functional' written like this: (integer) is an integer, and a pair is written like (pair type-1 type-2), a pair of a float and an integer:
(pair (float) (int)), basically, lose symbols not at the start of list are variables of the type, and can (usually) be filled with anything, that is why just 'integer', is an arbitrary type, but '(integer)' is the particular integer.

Some would be special, like (any) being an unspecified type, and (eql to-thing) for something eql to 'to-thing' (eql* to-thing), same but it is tested for whenever some value is not (eql to-thing) but a subset. (eql (number x)) being something equal to some unknown x. (or ...) being one of a set of types.

As an extension of better types, macros could use types as well, types choosing a macro just as a function would be choosen. Also, the types that it actually is can be passed on via the variables in the types. (defmacro name ((pair q r) (array s (eql (integer n)))) (a b &rest rest) ..something dependend on q,r,s,n, and a, b, rest.

References is another feature i miss. Don't see any reason not to let how functional the code is up to the programmer. In my project references will be 'special types', and would work in a few different ways; (let ((c 2)) (meh (ref c)). Then c is (integer), as 2 is, and (ref c) is (ref-var (integer)). (let ((c (ref 2)) (meh c)) should work too, ref should then create the space for the 2, and then make c a pointer to it, making c itself (ref-var (integer)) ref-var is for when it is a variable, and doesn't always need pointer-indirection. (ref ..) is just a pointer to something, but that can be treated as the value behind the pointer.

There is however another type of reference, that of a setf-function, well, i don't see the point of setf and setq- so i only have set, if you have both a (defun fun-name ( ..args..) ..) (defun (set fun-name) (to ..args..) ..), then you can: (let ((a (ref fun-name))) .. code where you can set and use 'a.)

Some other notation of nested lists, as i suggested here, what. The lang-lisp project has an implementation. I don't dig clojures vector things in {} at the moment, it seems a little arbitrary, and how do you decide when to do this.(I'd implement it as {&rest body} -> `({} ,@body), and let macros do the rest.) I guess both might cause some problems that people might start whine about conventions regarding when to use them.
MrSelfDefstruct wrote:Files are modules, implict namespacing (like python and otter)
Maybe it is better to do it optionally. Like (load :as-module "file.lisp"), and (load :as-prog "file.lisp").
The latter is another idea i have; being able to use programs as objects with a namespace, a structure for all the variables that are global, all the functions have as extra first argument this structure, and a main, that runs the program returns the final state.

Some other things is a better specification, relegating a lot of things that are in there to libraries. Better websites with documentation for basic libraries. With a good search function. (Hmm, maybe i should try see if i can make a search-keyword with a 'specialized' google search)

Cond with variables. I have made some common lisp macros like (when-with var cond &rest body), (if-with var cond if-t if-f), (if-use cond-out if-f), but not entirely sure how to do this properly with cond.

Slurping stuff directly from C files; (include<> "opengl.h"), producing output to javascript/flash and such would be very cool.

Forcing lisp to stay in different subsets of functions, as to make 'safe' scripting, where the code cannot damage your computer. For instance, as in an html-like 'language', force it to stick to functions determining how a page looks.

@danb: good one Edit: just realised, (if cond (ref a) (ref b)) would produce something settable. Not perfect though, still need to repeat ref. Maybe try make anything being setted to be a reference.. somehow.

Jasper
Posts: 209
Joined: Fri Oct 10, 2008 8:22 am
Location: Eindhoven, The Netherlands
Contact:

Re: What feature would you most like to see in Lisp?

Post by Jasper » Thu May 07, 2009 7:32 am

Perhaps lisp should either have more explicit separation of the function namespace, or be lisp-1: I just realized this:

Code: Select all

(defvar miauw 45)

(defpackage #:miauw
  (:use #:common-lisp)
  (:export miauw))

(in-package #:miauw)
(defun miauw (&optional (n 3))
  (dotimes (k n) (format t "Mew~%")))

(in-package #:cl-user)

(use-package '#:miauw)

(miauw 4)
As often, silly i didn't think of this before..

findinglisp
Posts: 447
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX
Contact:

Re: What feature would you most like to see in Lisp?

Post by findinglisp » Fri May 08, 2009 4:42 pm

IMO, Lisp-1 is a needless headache. It's useful for newbies to avoid early complexity, but later it seems like a straightjacket with no big benefit. FUNCALL is not as ugly as Lisp-1 proponents make it out to be.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

Jasper
Posts: 209
Joined: Fri Oct 10, 2008 8:22 am
Location: Eindhoven, The Netherlands
Contact:

Re: What feature would you most like to see in Lisp?

Post by Jasper » Sat May 09, 2009 3:55 pm

I agree, but i was talking about the namespacing. With choosing lisp-2 you do get a choice between really separating the function namespace for the packages or namespaces, etc, or only separating the symbols. CL has chosen the latter. One could argue that one should avoid having this choice.

One could separate the function namespace the other way by letting #' access the function namespace, rather then getting the function of that name; subtil difference being that then you would export functions with (:export #'fun) Still, i think it is rather minor.

Post Reply