libera/commonlisp - IRC Chatlog
Search
22:58:03
Guest74
I just noticed I'm getting a warning on a case slot with :INITFORM nil and :TYPE (or nil something)
23:08:21
rotateq
and I wanted to admit my logical failure of yesterday, of course an AND in the matching expression wouldn't make sense ^^ maybe in a quantum computer with quilc :)
23:28:56
temp1234
So, is an fexpr just a macro whose body is implicitly quoted? I've been trying to understand why you'd want them :)
23:30:22
hayley
Theoretically they are more powerful than macros, but I can't think of any uses of fexprs that macros don't do.
23:31:40
White_Flame
is a fexpr expcted to actualy execute the code in the runtime environment, instead of returning source code?
23:47:45
Nilby
I don't think fexprs are more powerful than macros, it's just that given fexprs you can make macros better than the other way around. Most of the time you want macros.
23:53:09
mfiano
Does the standard provide the building blocks for them, or do they require implementation support?
23:54:31
Nilby
You can make a macro that is the fexpr, but then you can't pass it to apply, so you have to make another function which you can apply. So it's a little clumsy, but you can do it in any CL.
23:55:56
mfiano
You can apply a macro if it also expands to that second function though, though maybe that is not possible in this specific context.
23:57:55
Nilby
It's a tiny bit different because applying the macro function just does the expansion and doesn't evaluate it.
0:09:38
Nilby
Let's just forgets fexprs. But this might clear it up or make it more muddy: https://plaster.tymoon.eu/view/2781#2781
0:33:52
_73
I am trying to use the `bst` package to make a binary search tree that can be controlled through a closure. The package however uses special variables to control a trees behavior. I want to be able to set these variable only in my lexical closure so they only control my one instance of a bst. I understand why this code does not work but am wondering if it is possible to do something like this with a closure, or if I need to use a
0:35:22
Bike
like, you do (let ((bst-copy-function #'identity)) (lambda (...) (let ((*bst-copy-function* bst-copy-function)) ...)))
0:38:29
_73
Perhaps I don't actually know why my code doesn't work. I was under the impression that you could not modify a special variable through a let binding.
0:42:40
mfiano
You can push new bindings to the stack with LET, and when the dynamic scope ends the value is popped off the stack
2:09:05
hayley
PROG2 should return the primary value of evaluating the second form, but the specification claims it returns the primary value of evaluating the first form.
2:14:04
rotateq
hm now more thinking about the differences fexprs vs macros (or rather sexprs, or maybe you can give me more hints)
2:15:16
hayley
fexpr stands for "funny expression" or something like that; it's independent to surface syntax like S-expressions.
2:26:06
rotateq
hm okay and mexprs was for meta-expressions. Wolfram still claims that Wolfram Language is the most advanced in existence. but sure they did and do a great job on many things
2:29:27
rotateq
very impressive, he wrote (much of or everything? hm ok not the existent fortran libs nor based langs) Mathematica 1.0, coming from his SMP, himself
2:32:33
rotateq
so to lastly be ontopic with it, maybe when building new things, we can learn from this too and improve it
2:45:04
jcowan
https://github.com/scheme-requests-for-implementation/srfi-1/blob/master/srfi-1-reference.scm
2:47:12
jcowan
but since almost every CL has tail recursion (if not general tail calling) then it's just a matter of respelling define as defun, etc.
2:54:50
Bike
rotateq: i've done some experiments with including fexprs in a compiled language, but it's entirely a pain in the ass, and I don't think it would be an improvement over macros in very many cases.
3:06:01
Nilby
I don't how to measure advancedness, but I do know how to measure scientific arrogance, and the unit is the "wolfram" and Mathematica is at about by 37 kiloWolframs by now, which is quite a lot.
3:08:08
rotateq
drakonis: i like much of his writings and he had much success since from 30 years now
3:09:35
hayley
Well, Wolfram didn't take the offer of using beach's term rewriting compiler, so he can't be that clever.
3:09:49
rotateq
and sure, not everything. but the blog article about Schoonschip and nobel prize laureate Martinus Veltman was interesting read. Veltman insisted on writing it in assembly
3:11:04
Nilby
unfortunately, his recent physics stuff is closer than most people think, and if people like stylewarning and friends don't realize they're reverse engineering qm into lambda calculus soon, wolfram & co might stumble into it
3:11:07
rotateq
oh yes, i think there are so many way more impressive people work for Wolfram Research, just take Oleg Marichev (the author of the five books on sum and integral tables), he did much work so that Mathematica can solve way more integrals
3:11:40
rotateq
but okay, when you work at a company they may be allowed to steal your ideas and make billions
3:15:09
Xach
I seem to remember at least one CL guy who worked there but I don't know if he did Lisp there.
3:17:05
hayley
I recall one Wolfram article which went off on Macsyma on Maclisp running on giant timeshared PDP-10s, whereas Mathematica(?) on C ran on a small PC. Never mind the, well, pretty large change in hardware performance.
3:17:17
jcowan
rotateq: when foo calls foo in tail position, that's tail recursion. When foo calls bar, that's general ("proper") tail calling.
3:17:24
rotateq
stylewarning: I remembered this funny thing from Feynman's auto biography, when his advisor Wheeler called and said "Feynman, I now know why all electrons are the same! They ARE all the same traveling through time and space."
3:18:00
rotateq
but should read many parts in the real lectures again the next two years to fresh up my physics too
3:22:05
hayley
I can't find it now, but I swear someone said some crap like that. Mathematica was released in 1988, which would mean there was literally a 20-year gap in hardware in such a comparison.
3:23:36
hayley
...apparently the first version was for the Macintosh, so if you had money I guess you'd have a 68030 by then?
3:24:27
hayley
(Somewhat amusing is that the 68000 was just used as a "front end processor" which played a part of booting a Lisp machine.)
3:28:47
hayley
Oh, I found the comment, and it was from some rando, not anyone from Wolfram. But it's hilarious to me.
3:29:06
hayley
"This announcement knocked my socks off. I recall MIT-MC, the multimillion-dollar DEC PDP-10 that ran Macsyma in the late 1970s. It was a scarce resource; labs from all over the world would pay tens of thousands of dollars per year to access the symbolic computation engine. Today, a far more-capable engine is available on a $50 computer."
3:29:45
Nilby
wolfram was trying to complete with macsyma and first wrote a thing called smp and got mad when the universiy said they owned it, so he quit and re-wrote it as mathematica, running on a tiny mac
3:31:11
hayley
(Well, the PDP-10 was first sold 1968, the Pi 1 was first sold 2012, but with old CPUs Broadcom basically didn't want to throw out...but you get the idea, no?)
3:33:52
Nilby
but sometimes good things come from people being mad universities and quiting to re-write some famous software
3:35:06
hayley
stylewarning: I saw someone selling a "retro computer kit" with a 68000 included. Well, that covers the FEP, but what about the rest of the machine?
3:43:58
rotateq
that was what Veltman also suggests for using assembly in computer algebra, that floating point ops are fasta. but physics also lives heavily from symbolic calculation
3:45:36
rotateq
stylewarning: hm iirc i should go on and install gfortran on my new machine, so i can finally compile/load the qvm and try playing with it :)
3:51:11
stylewarning
But we refactored MAGICL to not need that stuff necessarily https://github.com/quil-lang/magicl#requirements
3:53:47
rotateq
okay I don't remember what it let fail the last time i tried, but I want understand some day how this and quilc really works and does its impressive magic, so high respect for you people at rigetti
3:56:25
rotateq
hm i wonder if some maybe verbose (from APL view point) things in magicl can also replaced and made shorter with april, even when april becomes in some more things superior over the dyalog overoptimized implementation
4:01:30
Nilby
the lisp around the old fortran is both funny and sad. there must be a more palatable way
4:04:31
rotateq
Hello beach, don't worry, that bit offtopic may now be over. But of course interesting too.
4:10:24
rotateq
ldb: maybe OS X is so well designed as they often claim, it can also run multithreaded on 0 cores
4:10:24
beach
No, hayley forgot the details. It was not *my* term rewrite system, it was that of my thesis advisor, and he was the one doing the communication before I got involved. But I wrote the compiler for that term rewriting system, something nobody had done before.
4:21:55
beach
Yes. I wrote the compiler for the rewrite system in Franz Lisp (not to be confused with Allegro Common Lisp).
4:23:30
rotateq
but I learned this year that FranzInc is named after the hungary componist, I like some of his music
4:36:23
beach
Right. I don't think Franz Lisp had any influence on Common Lisp. Franz Lisp was mostly like Maclisp. It was specifically written for Unix as I recall.
4:38:19
rotateq
okay I have no idea, but am interested in those history details. one book of Herbert Stoyan I found some weeks ago from around 1980 covers over 100 pages just LISP history :)
4:52:29
rotateq
can you give me a simple example? and then how to correctly handle (optional) type parameters
4:58:14
rotateq
and which additional type specifiers I remember are defined by default are: satisfies, mod, eql, complement, and, or, not; which did i miss?
5:02:11
rotateq
stylewarning: okay it was about some libffi thingy so file it can't find on my machine, not gfortran
5:02:47
rotateq
beach: oh! so good i asked, or should have asked "which of those did i remember correctly?"
5:05:36
beach
An implementation that recognizes a call to TYPEP with a quoted type specifier and handles it efficiently.
5:06:51
beach
You would want your implementation to turn (TYPEP ... 'CONS) into (CONSP ...) for instance.
5:09:28
rotateq
I see. Like when SBCL for example sees an addition with two arguments and calls #'sb-impl::two-arg-+ on those.
5:10:10
rotateq
Or as is in heisigs fast-generic-functions the example with first binary-add and the reducing more arguments with that.
5:11:29
saturn2
you can consider the second argument to TYPEP as a little programming language which you compile into lisp
6:24:03
ldb
but I think april also need a fix, it might be to confident to assume everyone gets 2+ CPU cores.