<aeth>
I was thinking about a "perpeutal calendar", which, as that page says, is a lookup table
<aeth>
but there are quite a few direct algorithms
ebzzry_ has joined #lisp
<_death>
by "weekday" I understood "workday" (hence holidays are relevant)
<aeth>
_death: as I said, you can do a second pass to subtract holidays if it falls in the range.
<aeth>
only the holidays need tables (in particular, Easter)
whiteline has quit [Read error: Connection reset by peer]
whiteline has joined #lisp
<_death>
note that holidays are political and subject to change ("business logic")
<aeth>
DST, too
<aeth>
DST can affect what day something falls on
<_death>
so having a bitset representation is convenient to allow such ad hoc changes.. in fact it could be made into a project resembling the time zone database, and become useful to many people.. maybe there's already a project like that
random-nick has quit [Ping timeout: 264 seconds]
ebzzry_ has quit [Read error: Connection reset by peer]
<_death>
though such a project could get more ambitious and need a more complex representation to support all kinds of annotations
iAmDecim has joined #lisp
<MichaelRaskin>
Note that some _parts_ of Germany have a ton of holidays of form Easter+N. The original meaning of holiday, yes. Different parts seem to have different amounts.
<aeth>
If you keep a database of holidays, congratulations, you have now chosen the project that will occupy you for the rest of your life.
<Bike>
surely some poor person working for a bank has started that project already
<MichaelRaskin>
Then there is Russia where it is completely normal to have a working Saturday to bridge preceding Tuesday holiday with preceding weekend
sonologico has quit [Ping timeout: 240 seconds]
<aeth>
Bike: When has something already being written stopped someone from writing it again?
Kevslinger has quit [Quit: Connection closed for inactivity]
<Bike>
this dream i had once where if you wrote something unoriginal you'd be eaten by a nuckelavee.
<MichaelRaskin>
This reminds me the story about greetings in an IRC channel where posting a line that has ever been posted leads to a kick
<Bike>
robot nine thousand?
noahf has joined #lisp
<aeth>
MichaelRaskin: alternatively, you can start with the most common line in any channel and work your way down from there...
<aeth>
Good morning everyone!
<aeth>
:-P
prince1 has joined #lisp
prince1 has quit [Ping timeout: 240 seconds]
noahf has quit [Quit: oops]
ear-the-art has quit [Ping timeout: 256 seconds]
orivej has quit [Read error: Connection reset by peer]
refpga has quit [Read error: Connection reset by peer]
orivej has joined #lisp
refpga has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
srandon111 has joined #lisp
oxum has joined #lisp
<srandon111>
guys can you suggest some good book to learn clisp?
<aeth>
srandon111: clisp is a great short name for Common Lisp, but unfortunately, CLISP is an implementation (and not the most popular one), so we tend to use CL
Codaraxis has quit [Read error: Connection reset by peer]
<pjb>
or COMMON-LISP which are the names of the CL package that you must use to use CL.
<White_Flame>
srandon111: that book is the most commonly recommended one here
bilb_ono has quit [Quit: bilb_ono]
<aeth>
pjb: or you could call it, as a long name... COMMON Object-oriented Modern Mathematical Omnipresent Necessary Lisp
<White_Flame>
...Necessary Language Involving Symbolic Processing
<aeth>
White_Flame: But only the COMMON part is recursive in my acronym
<aeth>
So after the first recursion, it's just common
<aeth>
I guess you could make it COMMON-LISP instead
<White_Flame>
COMMON Object/Mathematical Manipulating Operational Notation LISP Integrating Symbolic Processing
* White_Flame
declares "LISt Processing" dead
<aeth>
oooh
<aeth>
that's true, it's all about LISP processing now
<aeth>
I like "Operational Notation"
iAmDecim has joined #lisp
oxum has quit [Ping timeout: 256 seconds]
<aeth>
I do like how that does explain everything you can do with it, too. OOP, functional programming ("mathematical"), and macros ("symbolic processing")
mwgkgk_ has joined #lisp
jonatack has quit [Ping timeout: 272 seconds]
space_otter has joined #lisp
oxum has joined #lisp
bitmapper has quit [Ping timeout: 240 seconds]
mwgkgk_ has quit []
mwgkgk has joined #lisp
<srandon111>
thanks aeth
<srandon111>
are there other good resources to learn lisp?
<srandon111>
something like interactive excercises and similar?
<White_Flame>
"Land of Lisp" is another instructional book that uses game making exercises
<White_Flame>
it's not as explanatory, but if doing & figuring out how it works is more your learning style, that can be good
oxum has quit [Ping timeout: 256 seconds]
<srandon111>
White_Flame, so should i go with sbcl ?
iAmDecim has quit [Ping timeout: 265 seconds]
<White_Flame>
as a learner, the differences between the various implementations aren't going to be noticeable
<aeth>
srandon111: SBCL is currently the most popular implementation
<White_Flame>
SBCL is certainly the most popular here, though, because of the fast code it generates
<srandon111>
okok
<srandon111>
thanks
<aeth>
SBCL is more popular than CCL which is more popular than the rest, but of course exact numbers would be hard to find
<srandon111>
ok another thing... are there any advantages in learning common lisp wrt to clojure... i mean interms of libraries and modernity?
<White_Flame>
CCL had much stronger cross-platform support than SBCL, but I think the latter has basically caught up
<srandon111>
mayeb it is a stupid question
<White_Flame>
both are fairly niche languages
<srandon111>
but i know clojure is very modern asa language
<srandon111>
so i was wondering what do you think about it
<aeth>
what does "modern" mean?
<White_Flame>
"recent", yes. "modern"? who knows
<mwgkgk>
some libraries, yes: Clx for lisp is probably better than java X11 bindings
<mwgkgk>
which additionally goes for StumpWM which has no real counterpart in clojure
<White_Flame>
and if you're working with Java libs imported into clojure, you're going to be dealing with Java-isms all the time, which is a downside
<aeth>
As far as "modern" dynamic languages, what you tend to get are gradual typing (SBCL has this, through type declarations) and some form of embedded regex (CL doesn't have this, but you could just write a trivial reader macro on top of cl-ppcre or something else
<Ober>
especially on NPEs
<aeth>
Maybe JSON in the standard library too but that's so unimportant when every other language has like 5 JSON libraries
<White_Flame>
lisp's "package manager" is called quicklisp, and has some thousands of libs easily loadable
<Ober>
White_Flame: interesting... I can't find reference to it in the clhs, or the spec... :P
<White_Flame>
lisp was a bit late to the party on that one, primarily because it's pretty easy to roll your own stuff and there's less reliance on libs
<aeth>
I guess modern could include package managers (CL has these) as well as system threads (so you can use all 16 cores or whatever you happen to have) and CL doesn't have threads in the standard, but nearly every implementation has them, and you can portably use them with bordeaux-threads
<aeth>
another thing about modern is Unicode, which, yes, most CLs have. Most implementations are (or at least can be) 64-bit, too.
<aeth>
Is anything else missing from a list of modern features?
<Ober>
and lisp code today will continue to run in 30 years
<White_Flame>
Ober: that's not very modern. ;) Modern would require rewrites every few months
<Ober>
that's fast fashion :P
<srandon111>
aeth, yes i meant recent
<Ober>
JS being a lisp, I still run js I wrote in 97
<aeth>
White_Flame: well, no, most languages (Python 3 excluded) keep backwards compatibility, and you rewrite your code because of the libraries changing, not the language. Sort of like how the Linux API is stable but that doesn't mean that your 1995 binary will still run, because of the libraries.
<White_Flame>
yeah, it has the web keeping everything old working
<White_Flame>
(^re Ober)
<White_Flame>
aeth: right, I more meant a modern ecosystem is a fast moving target
<White_Flame>
rather than purely the language spec
<Ober>
funny thing, gf had an unopened Navigator 1.0 box, still in shrinkwrap. the binary for bsd ran still on x86 netbsd...
<aeth>
I guess some languages deprecate, but they tend to err on the side of having the same feature implemented 5 times but only the newest one implemented well, just to avoid breaking old code
<White_Flame>
but taking JS as an example, the language is pretty messy, and thus the libs redefine the programming environment to make it "better", so the frameworks tend to be more definitive than the lanuage. That also includes polyfilling and such so that the underlying language becomes more hidden
<aeth>
eh
<Ober>
^^ good point
iAmDecim has joined #lisp
<aeth>
CL absolutely gives you the freedom to mess things as much as you want
<White_Flame>
yeah, CL libs tend to be more composable
<White_Flame>
JS tends to be encompassing scope redefiners
oxum has joined #lisp
<aeth>
People probably reject dramatic redifintions of the language because CL gives you so much freedom, so such libraries are completely incomprehensible and might as well be new programming languages
<White_Flame>
and it's the opposite in JS because people fundamentally hate the base language they're forced to use ;)
<Ober>
transpiler would be nice to have
Jeanne-Kamikaze has joined #lisp
<White_Flame>
Ober: macros are transpilers
<Ober>
which ones?
<White_Flame>
all of htem
<Ober>
aye
<White_Flame>
(CL macros, specifically)
<Ober>
well I meant, compiler macros, or
pilne has quit [Quit: REALITY.SYS Corrupted: Re-boot universe? (Y/N/Q)]
<White_Flame>
ah, well defmacro is the most clearly matching
<White_Flame>
since there's no fallback or anything. The output must be valid in the lower language
<aeth>
that doesn't mean anything, though, since you can use a reader macro to essentially completely change everything
<Ober>
for me running a clojure shop, the cto wanted to do all the CL ways with it, but in the end it's just java.
<Ober>
"save image" noop.
<Ober>
isn't there a clojure package for cl to support some of it's features?
<White_Flame>
cloture
<White_Flame>
I have it bookmarked, but I don't know clojure yet so I don't know how well it works
<aeth>
eww, I don't know what's worse, that it uses .lisp for clojure files or that Github detects it
<aeth>
it uses the same library as Gitlab so that might explain why most of my Scheme is erroneously being identified as Scheme. My macros are too good at faking Scheme from CL.
SGASAU``` has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
fookara has quit [Remote host closed the connection]
SGASAU`` has quit [Ping timeout: 264 seconds]
SGASAU``` has quit [Remote host closed the connection]
ebzzry_ has joined #lisp
frodef` has quit [Ping timeout: 265 seconds]
SGASAU``` has joined #lisp
SGASAU``` has quit [Remote host closed the connection]
SGASAU``` has joined #lisp
charles235 has quit [Ping timeout: 256 seconds]
refpga has quit [Read error: Connection reset by peer]
charles235 has joined #lisp
<srandon111>
Ober, what? JS ?
refpga has joined #lisp
charles2` has joined #lisp
<srandon111>
anyway what do you like about lisp wrt other programming languages?
<srandon111>
i mean are these macros used so often?
charles235 has quit [Ping timeout: 240 seconds]
<White_Flame>
I really need to record my thoughts on that, as I've expressed it often
* White_Flame
searches
<no-defun-allowed>
I use them enough that not having them could be annoying, but I don't try to use them frequently.
<srandon111>
no-defun-allowed, can you make some examples?
<aeth>
White_Flame: I used to be like that, but now all I do is write macros
<srandon111>
aeth, isn't it a bad programming practice?
<no-defun-allowed>
In my opinion, the interactive environment is well above average (it could be better, but it's still superb).
<no-defun-allowed>
I guess the macro is trivial enough, in that (define-script name constants . body) expands to (defparameter name (compile-program constants body)), but having the code be normal lists and symbols instead of some other structure makes writing a program fairly simple.
<phadthai>
I like that it's fast for prototyping without caring about optimization and then it can be worked in where too slow; I like the interactive and incremental development; I like that for every problem that can be expressed more elegantly it doesn't always mean needing to rewrite a language or config parser or interpreter sacrificing performance (macros are great there)...
choegusung has joined #lisp
<phadthai>
there are things to dislike of course too, on some very small systems, if not wanting cross-compiling, lisp might just be too heavy vs another interactive language like forth
<White_Flame>
the thing is, many languages have taken on aspects of lisp (first class functions, GC, rich numeric stack & type system, REPL, etc) but none integrate it together as well as lisp does, because their code forms are not plain data
<White_Flame>
syntax becomes the enemy when you're running code at compile-time, or transforming data specs into runnable code
<phadthai>
another is that popular languages have tons of libraries that may lag behind for lisp or just be too sparsed among disparate individual developer repositories, the work to interface to other stuff like FFI can be challenging at first too
<no-defun-allowed>
There are also compilers (not batch compilers, like gcc or ghc, they can be invoked at runtime) that produce decent machine code for unoptimised programs, which as phadthai says, lets you leave the most optimisation for the slowest parts.
<srandon111>
no-defun-allowed, i can't understand the purpose....
<srandon111>
defines a program for the bytecode interpreter??? to what purpose?
<White_Flame>
for running your own bytecode machine
<no-defun-allowed>
There's a lot of context you would want, but I have a bytecode interpreter which can be run by other people over a network to do things reproducibly.
<srandon111>
White_Flame, i am too noob to understand the applications
<srandon111>
also by reading the one conversation you kept
Oladon has quit [Quit: Leaving.]
<srandon111>
i can't understand what those applications are
<White_Flame>
lisp is a great language to create small embedded utility languages inside of it; and/or create new high level languages on top of it and not worry about machine code details
<srandon111>
or how macro would help solving them
<White_Flame>
right, that's what I referenced in the pastebin above
oxum has quit [Ping timeout: 264 seconds]
<White_Flame>
if you haven't hit the limits in other langauges yet, it's nearly impossible to describe the benefit
<White_Flame>
because the pain point it addresses so well isn't known yet
<no-defun-allowed>
Okay, another one. You can invent your own namespaces in Lisp using macros, which IMHO is a bit cleaner and more general than using decorators in Python.
<srandon111>
namespaces??
<srandon111>
i mean they depend on the files in python
<srandon111>
i mean on the filename
<aeth>
srandon111: It depends on what you're doing. Sometimes what you're doing is best expressed as a macro.
<srandon111>
not on the decorators
<no-defun-allowed>
namespace: a mapping of names to datum
<phadthai>
it's a compiled language that evolved many dynamic aspects, as such it's also interesting: can be surprisingly fast with good code on a good implementation, while at the same time very dynamic; things like the distinction between defvar and defparameter are also important, it decides what happens at image load time or when recompiling some code in a live interactive image
<srandon111>
no-defun-allowed, aren't you talking about namespaces as i know them in java/ and so on?
<aeth>
srandon111: Once you're used to macros (which takes a while) a macro is just list traversal. The hard part is making it look like it was built into the language so people can actually read the macro. What you don't want is something like LOOP, but e.g. writing your own CASE with a different quality test is perfectly fine
<no-defun-allowed>
Not so much like any other language, just in a general sense.
<aeth>
s/quality test/test/
<aeth>
I'm not sure what I was trying to say there
<no-defun-allowed>
Say you have a web server framework, and you want to define a function for handling some page. In Python you might write @get("/url") def url_handler(...): ...
<no-defun-allowed>
In Lisp the framework could write (define-easy-handler (url-handler :url "/url") ...)
<srandon111>
no-defun-allowed, since i think this thing about macro is quite questioned by noobs like me... isn't there a website/resource which tries to explain the benefits with examples?
choegusung has quit [Quit: leaving]
<no-defun-allowed>
The mapping of URLs to handlers would be a namespace to me.
<aeth>
no-defun-allowed: right, properly written macros look more built-in than other a lot of other languages' metaprogramming, particularly C++<template<template<template<template... and Python/etc. @stuff
<aeth>
So it actually stands out less
<phadthai>
and in lisp the html templates can result in much native code (much processed at compile time) vs all interpreted
<aeth>
And if you use the right names, nobody's going to confuse a macro and a function, especially since a macro probably should have a &body
<aeth>
And since you can see the API in something like Emacs, if you see &body you know it's a macro
<srandon111>
aeth, yes most likely i am missing all this stuff since i still don't really know well lisp
<aeth>
phadthai: right, any kind of HTML template system is either going to turn into a constant string at compile time, or (if it takes in input) it's going to generate something more or less like a FORMAT string
<srandon111>
i learned a little bit of clojure
dreamcompiler_ has quit [Quit: dreamcompiler_]
charles2` has quit [Ping timeout: 256 seconds]
<White_Flame>
srandon111: simple case: You want to add instrumentation to your code, to track execution for profiling, coverage, whatever. The desire is "Every time I define a function, I want it statically recorded somewhere in a table, and on entry/exit it should call code and report on its parameters automatically. It's a right pain in other languages; in CL you simply wrap DEFUN in another macro
ebzzry_ has quit [Remote host closed the connection]
<phadthai>
aeth: I agree to you agreeing :)
<aeth>
srandon111: I think Clojure is more culturally against macros than Common Lisp is. In Common Lisp, it's fine as long as it fits a simple pattern, like WITH- (usually wrapping an UNWIND-PROTECT, but sometimes just a LET), DEFINE- (almost always ultimately just a DEFUN), etc.
<srandon111>
aeth, yes exactly
<no-defun-allowed>
Yeah, Clojure does not use macros so much.
<aeth>
oh, another one that's a bit less common is DO-, for custom iteration
<srandon111>
White_Flame, damn... now i understand... cool
<aeth>
e.g. DOLIST built in because DOLIST existed before the - was invented.
<aeth>
I kind of hate the DO-FOO pattern a bit because that can get annoying... iterators in LOOP (which aren't a thing) would be a lot more convenient
<White_Flame>
srandon111: and that DEFUN macro can look at the _source code_ of the DEFUN, and handle the name, the literal parameter list, etc, and generate the _source code_ which performs all the registrations and wrap the body source code of the defun wiht the tracking stuff
prince1 has joined #lisp
Oladon has joined #lisp
<White_Flame>
since it's all just lists
iAmDecim has quit [Ping timeout: 264 seconds]
<White_Flame>
(for the most part... some devlish details)
<srandon111>
White_Flame, that's cool
<srandon111>
now i am starting to understand
<aeth>
In general, the scariest macro you're going to see is a DEFINE-FOO that is built on DEFINE-BAR that is built on a DEFINE-BAZ that is built on a DEFINE-QUUX ... etc. that ultimately is a DEFUN
<White_Flame>
and any little clause in the language can be generated in the same way
<aeth>
But in the case I gave, you just repeatedly use MACROEXPAND-1
<aeth>
since the top level is always the relevant macro
<aeth>
It gets messier if the relevant macro is nested in the interior
<srandon111>
White_Flame, anyway this isn't masking source code to others?
<srandon111>
i mean having a macro called DEFUN
<White_Flame>
and that transformation is just plain lisp code, which can call all the same utility functions etc (as long as they're there at compile-time)
<srandon111>
while this is also a keyword for another thing...
<White_Flame>
you can literally have your own DEFUN that source code will syntactically use, by setting up your packages right
<no-defun-allowed>
Usually a macro makes the language one works in "higher level", by allowing the client to ignore how it's implemented.
<White_Flame>
or, you can have DEFUN* or whatever variant that you specifically use intentionally
<White_Flame>
I think you meant "alias"?
<aeth>
There's exactly one time when a macro is really, really bad and that's code-walker macros. No one does them correctly. Imagine a macro that walks through the source and replaces all (foo 42) with "Aeth is the best programmer because Aeth writes the most clever macros." There are so many ways that can break.
<White_Flame>
or "shadowing"?
<aeth>
And it's so hard to figure out what's going on in a codewalker, too.
<no-defun-allowed>
It's more of a case of "I don't want to know", rather than "I don't get to know"; but MACROEXPAND (or the macroexpander mode in SLIME, invoked using C-c M-e) lets you figure out what the macro does.
<White_Flame>
and building onf n-d-a's comment, Lisp is one of the only runtime-compiled languages that actually lets you drill allt he way down to the assembly language to see what's going on
prince1 has quit [Ping timeout: 256 seconds]
SGASAU``` has quit [Ping timeout: 240 seconds]
SGASAU``` has joined #lisp
<aeth>
Keep in mind though that if a macro doesn't have a &body (more rarely, some other form of nested destructuring), it's almost always a bad idea because you can just inline a function instead. Obviously, it's needed for things like OR, though.
<srandon111>
White_Flame, aeth why macros are discouraged in clojure?
* White_Flame
isn't a clojure programmer
<srandon111>
sorry i means aeth
<srandon111>
ok so basically with macros i can pass "the body" of a function to it and modify as i wish it right?
<White_Flame>
generally you wrap it or generate additional code
<no-defun-allowed>
They try to do things very functionally, from what I've heard.
<White_Flame>
but yes, you can break down a code body given to it, with constraints
<aeth>
I'm not a Clojure programmer, either, but I'm guessing that the more purely functional your language is, the more you prefer higher order functions, which do pretty much all of the same things, just syntactically differently. In fact, quite a few macros are just wrappers over a higher order function or a lambda (all the DEFINE- ones are basically just globally binding a lambda)
CrazyPython has joined #lisp
<White_Flame>
srandon111: consider IF. It has 'test', 'then' and 'else'. You treat those as opaque code blocks that you assemble a larger body with
<White_Flame>
and arrange them such that only 1 of THEN or ELSE ever actually execute
<White_Flame>
COND is actually defined to be a macro, not a built-in special form
<White_Flame>
because you can tack together code snippets into an IF tree or other ways
<aeth>
srandon111: (let ((x 42) (y 43)) (+ x y)) is the effectively the same thing, and could be implemented, as ((lambda (x y) (+ x y)) 42 43) so you never need macros as long as you have lambdas, technically.
<aeth>
Of course, the LET is clearer, and if you want to do LET* the same way, you're going to get much, much messier because now you have to next lambdas of one variable... but it's not that bad if you have a currying macro or however that's done.
CrazyPython has quit [Read error: Connection reset by peer]
<aeth>
I don't know about Clojure, but I do know that in Scheme, they really love making everything ultimately just be a lambda if you dig deeply enough.
<aeth>
Common Lisp isn't as purist, a lot of things in macros are ultimately just contained gotos in the form of GO within a TAGBODY (or implicit TAGBODY)
<no-defun-allowed>
As another example of macrology, look at a demo like https://www.youtube.com/watch?v=prIwpKL57dM&t=1217 that I found in my logs. Instead of writing an interpreter for this little simulation as the presenter did, you could generate Lisp code that does what the rules do.
CrazyPython has joined #lisp
<srandon111>
White_Flame, ok so basically i can wrap my function to do e.g., debugging... but what are other typical applications?
<White_Flame>
yes, that's another thing. It's generally as easy (or easier) to write a compiler in lisp than an interpreter
<aeth>
This has some implications. Common Lisp and Scheme both have nearly-identical DO macros, but if you create a closure in Common Lisp, the DO will capture the final binding of the variable, while Scheme will remember the value, because Scheme used lambdas and Common Lisp used gotos so Common Lisp was updating the environment each time while Scheme was making a new one.
<srandon111>
i am imagining function generation?
<srandon111>
but for that i need code walkers
<srandon111>
and you said that they are bad
<White_Flame>
function generation is fine
<White_Flame>
given a code body, trying to dissect it can be problematic because you don't ultimately know what's code and what's data in those sublists
<White_Flame>
so construction via macros is fine. Destructuring bodies inside macros can be problematic in edge cases
<srandon111>
i mean what do you them for generally?
<srandon111>
function generation?
<srandon111>
or wrapping a function for debugging?
<aeth>
White_Flame: Well a compiler in Lisp just targets asm in s-expression form or native Common Lisp itself (since the compiler will just run on it eventually anyway), while an interpreter will target some abstract machine... so compilers are a bit easier than interpreters in Common Lisp imo.
<White_Flame>
sure, completel function generation, defining data tables & code bodies from specs, adding features to defun/defstruct/etc, doing custom tests, etc
<White_Flame>
srandon111: the thing is, I was a metaprogrammer in other languages, and it was a massive pain
<White_Flame>
lisp made all that complexity go away, and makes codegen such a simple and integrated operation that you don't even think anything special or difficult of it after a while
<aeth>
srandon111: if my codewalker expands (foo 42) to "Hello world" then (foo 42) looks like a function, but it never existed. Depending on the implementation, it might also erroneously substitute (foo 42) in (let ((foo 42)) ...)
<srandon111>
White_Flame, wait ... " defining data tables & code bodies from spec" what? how?
<White_Flame>
it's just a natural part of programmign
<White_Flame>
srandon111: it's just transformations
<White_Flame>
data in, data out
<White_Flame>
data in is spec, data out is code
<srandon111>
White_Flame, do you have some examples i can give a look at?
<srandon111>
White_Flame, ok so basically macros are a way to do metaprogramming...
<aeth>
srandon111: In Common Lisp a macro is basically just something like this, with bindings in and some quoted source form as the output: (defmacro foo (&body body) `(quote ,body))
<aeth>
I chose QUOTE as the simplest macro to demostrate because then you can do (foo a b c d) and get (A B C D) out. Otherwise, it would try to evaluate.
<White_Flame>
and you can't define stuff like that in functions
<White_Flame>
things like passing in names of local variables; a macro can expand into doing something with that var, while you'd have to do tedious wrapping to make a function out of it
<aeth>
This is slightly more useful: (defmacro reverse-call (&body body) (reverse body)) (reverse-call 1 2 3 +) => 6
<White_Flame>
(npush-list (list 1 2 3) foo) will expand to:
<White_Flame>
(setf foo (nconc (list 1 2 3) foo))
<White_Flame>
"foo" canbe the name of a local variable
<phadthai>
setf is nice
<phadthai>
also symbol-macro
bendersteed has joined #lisp
<phadthai>
hmm symbol-macrolet
<White_Flame>
so the macro expands to destructively concatenating a list in the front of the existing value of the variable
<aeth>
90% of Common Lisp macros come down to understanding quasiquote, although if they're really trivial like my reverse-call macro, they don't even need that, they just need to return a list at the end.
<White_Flame>
but even look at stupid things like "must-not" in line 228
<White_Flame>
` and , and ,@ are list template substitution things
<White_Flame>
but the model of what's going on is that it takes source code, and returns source code, which is compiled into your functions
<aeth>
` just makes things look like the resulting source code and aren't really needed, you can do (list a b 'c 'd) or you could do `(,a ,b c d) and it's the same thing. Generally, you prefer ` unless you need to put a ` in a ` in which case good luck knowing how to read the nested layers of unquoting ,
<phadthai>
and with- macros, destructuring-bind, the condition system, clos,
<srandon111>
White_Flame, ok let's continue this conversation in few days i mean i clearly need some studying
rwcom has joined #lisp
<White_Flame>
yep. Also, it probably would be useful to shift to #clschool at that point
<aeth>
,@ is a bit trickier because it splices the following list in. It basically removes a layer of parens. So something like `(progn ,@body) is fairly common in macros because it takes a list of Lisp syntax and puts a PROGN in front so it doesn't try to funcall the first element, but instead executes them in order
<aeth>
note that body is a list, which is why you ,@ instead of , to place it in the progn.
<aeth>
For that particular use of ,@ you could just do (cons 'progn body) instead.
<srandon111>
White_Flame, ok thanks i did that... also if i have to admit that for now... to me it seems more appealing the lambda philosophy of scheme languages
CrazyPython has quit [Remote host closed the connection]
CrazyPython has joined #lisp
CrazyPython has quit [Read error: Connection reset by peer]
<White_Flame>
srandon111: yes. Scheme started as an academic minamalist language, which meant you need to build everything from scratch
ebzzry_ has joined #lisp
<aeth>
Other than the use of ` , ,@ and GENSYM, macros are basically just regular list processing.
CrazyPython has joined #lisp
<White_Flame>
common lisp formed by coalescing together a bunch of commercial Lisp implementations, and has a very practical basis
<aeth>
GENSYM is... a bit more complicated. Basically, you want to do (let ((g (gensym))) `(defun foo (,g) ... ,@body)) if you don't want the code in body (which is the user's code) to be able to see the variable g
<aeth>
srandon111: well, Scheme prefers lambda and CL prefers (unhygienic) macros. You can do one style in the other language (at least if the Scheme provides a defmacro or define-macro)
EvW1 has quit [Ping timeout: 256 seconds]
<aeth>
Even Scheme has LET. Just like Scheme prefers non-generic code (compared to CL, which is often generic), but even Scheme's + is generic because converting between number types would be annoying.
CrazyPython has quit [Ping timeout: 240 seconds]
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
prince1 has joined #lisp
ebzzry_ has quit [Remote host closed the connection]
akoana has joined #lisp
refpga has quit [Ping timeout: 256 seconds]
prince1 has quit [Ping timeout: 265 seconds]
gioyik has joined #lisp
ebzzry_ has joined #lisp
mrcom has quit [Ping timeout: 265 seconds]
shangul has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
dreamcompiler has joined #lisp
mwgkgk has quit [Quit: Connection closed for inactivity]
ebzzry_ has quit [Remote host closed the connection]
dale has quit [Quit: dale]
refpga has joined #lisp
dale has joined #lisp
mrcom has joined #lisp
Necktwi has quit [Read error: Connection reset by peer]
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
Necktwi has joined #lisp
prince1 has joined #lisp
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
prince1 has quit [Ping timeout: 265 seconds]
ebzzry_ has joined #lisp
Oladon has quit [Quit: Leaving.]
Bike has quit [Quit: Lost terminal]
mason has left #lisp [#lisp]
SGASAU``` has quit [Read error: Connection reset by peer]
SGASAU``` has joined #lisp
Jeanne-Kamikaze has quit [Remote host closed the connection]
|Pirx| has quit [Remote host closed the connection]
|Pirx| has joined #lisp
iAmDecim has joined #lisp
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
dale has quit [Read error: Connection reset by peer]
dale_ has joined #lisp
dale_ is now known as dale
Kevslinger has joined #lisp
dale___ has joined #lisp
dale has quit [Ping timeout: 256 seconds]
dale___ is now known as dale
dale_ has joined #lisp
dale has quit [Disconnected by services]
rumbler31 has quit [Remote host closed the connection]
dale_ is now known as dale
gravicappa has joined #lisp
dale has quit [Ping timeout: 256 seconds]
dale has joined #lisp
vlatkoB has joined #lisp
sauvin has joined #lisp
aindilis has quit [Remote host closed the connection]
narimiran has joined #lisp
dale has quit [Ping timeout: 240 seconds]
dddddd has quit [Remote host closed the connection]
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 256 seconds]
aindilis has joined #lisp
gioyik has quit [Ping timeout: 250 seconds]
akoana has quit [Quit: leaving]
refpga has quit [Ping timeout: 250 seconds]
<beach>
Good morning everyone!
prince1 has joined #lisp
oxum has joined #lisp
dale has joined #lisp
orivej has quit [Ping timeout: 250 seconds]
prince1 has quit [Ping timeout: 260 seconds]
oxum has quit [Ping timeout: 250 seconds]
refpga has joined #lisp
dale has quit [Read error: Connection reset by peer]
dale_ has joined #lisp
dale_ is now known as dale
dale has quit [Read error: Connection reset by peer]
dale has joined #lisp
dale has quit [Client Quit]
heisig has joined #lisp
_Posterdati_ has joined #lisp
balavir has joined #lisp
Posterdati has quit [Ping timeout: 264 seconds]
oxum has joined #lisp
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
Grauwolf has quit [Quit: WeeChat 2.7.1]
refpga has quit [Ping timeout: 256 seconds]
shka_ has joined #lisp
sonologico has joined #lisp
<adam4567>
a recent sbcl save-lisp-and-die 53 megs! Is it normally so huge?
<no-defun-allowed>
With compression or no compression?
ebzzry_ has quit [Read error: Connection reset by peer]
<adam4567>
No compression, not sure * (sb-ext:save-lisp-and-die "cmimage.mem" :executable t)
<adam4567>
but no real trimmings either
<no-defun-allowed>
The core file I have to make SLIME start faster is 46MB, but I can't remember if it's compressed.
<adam4567>
46 is in a similar ball-park
<no-defun-allowed>
Okay, it's uncompressed (you pass :compression <compression quality; 1 through 9> to compress)
<beach>
adam4567: That order of magnitude is to be expected. It contains things like the compiler.
<adam4567>
OK. Understood. Will see how runs, anyway.
<no-defun-allowed>
But yes, Common Lisp images usually contain the debugger, compiler, and everything that was present before you S-L-A-Died.
<no-defun-allowed>
I get 40MB and 11MB uncompressed and compressed (using :compression 9) images, respectively.
<adam4567>
Hmm. OK. We'll see how it goes. (It sure took several seconds to save).
refpga has joined #lisp
<adam4567>
Like, to use it, sbcl must load first anyway, then load the image.
<adam4567>
whereas it'd be faster to load sbcl and evaluate a form
<no-defun-allowed>
Er, the image is basically a copy of everything in memory, SBCL doesn't need to load anything else.
<adam4567>
load sbcl, load a package, evaluate a form, I mean
<beach>
adam4567: What do you think "load sbcl" involves?
<no-defun-allowed>
I sure hope not; the SLIME manual told me dumping an image would make it load faster.
shka_ has quit [Read error: Connection reset by peer]
shka_ has joined #lisp
<adam4567>
looking through sbcl manual now, trying to find how to Load the image .. do forgive me. sbcl -M image.mem I thought
oxum has quit [Remote host closed the connection]
<no-defun-allowed>
sbcl --core core-file
<no-defun-allowed>
I think -M is for CLISP.
<adam4567>
right, last time I used it was clisp. Thanks
<adam4567>
3.3.1 Runtime Options OK
oxum has joined #lisp
Grauwolf has joined #lisp
Grauwolf has quit [Changing host]
Grauwolf has joined #lisp
<adam4567>
\leave
peterhil has quit [Ping timeout: 264 seconds]
adam4567 has left #lisp ["ERC (IRC client for Emacs 26.3)"]
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
tessier has quit [Ping timeout: 240 seconds]
tessier has joined #lisp
tessier has quit [Changing host]
tessier has joined #lisp
narimiran has quit [Ping timeout: 265 seconds]
oxum has quit [Remote host closed the connection]
slyrus__ has quit [Quit: Leaving]
prince1 has joined #lisp
zaquest has quit [Quit: Leaving]
gko has quit [Ping timeout: 250 seconds]
prince1 has quit [Ping timeout: 250 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
wxie has joined #lisp
wxie1 has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
wxie1 is now known as wxie
heisig has quit [Ping timeout: 250 seconds]
oxum has joined #lisp
iAmDecim has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
Inline has joined #lisp
zaquest has joined #lisp
random-nick has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
wxie has joined #lisp
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life_ is now known as Lord_of_Life
Lycurgus has joined #lisp
bah has joined #lisp
bah has quit [Client Quit]
iAmDecim has joined #lisp
space_otter has quit [Remote host closed the connection]
narimiran has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
gko has joined #lisp
wxie has quit [Ping timeout: 258 seconds]
wxie has joined #lisp
monokrom has joined #lisp
oxum has joined #lisp
<Gnuxie[m]>
Will ELS 2020 be on twitch?
refpga has quit [Remote host closed the connection]
oxum has quit [Ping timeout: 260 seconds]
ear-the-art has joined #lisp
<Shinmera>
Possibly. There's no decision yet.
<Gnuxie[m]>
Oh wow, I didn't think it was being considered, that's exciting
<Shinmera>
If it is on Twitch it would be pre recorded talks and a reduced programme.
<Gnuxie[m]>
Okie :)
rippa has joined #lisp
prince1 has joined #lisp
Inline has quit [Quit: Leaving]
wxie has quit [Ping timeout: 260 seconds]
prince1 has quit [Ping timeout: 256 seconds]
__jrjsmrtn__ has joined #lisp
_jrjsmrtn has quit [Ping timeout: 260 seconds]
zxcvz has joined #lisp
Necktwi has quit [Ping timeout: 240 seconds]
karlosz has quit [Quit: karlosz]
ebzzry_ has joined #lisp
Necktwi has joined #lisp
rotty has quit [Ping timeout: 260 seconds]
cpape` has joined #lisp
easye has quit [Remote host closed the connection]
cpape has quit [Read error: Connection reset by peer]
easye has joined #lisp
wxie has joined #lisp
prince1 has joined #lisp
igemnace has quit [Quit: WeeChat 2.7.1]
prince1 has quit [Ping timeout: 256 seconds]
jonatack has joined #lisp
Inline has joined #lisp
ebzzry has joined #lisp
ebzzry_ has quit [Remote host closed the connection]
igemnace has joined #lisp
oxum has joined #lisp
Lycurgus has quit [Remote host closed the connection]
oxum has quit [Ping timeout: 250 seconds]
ebzzry_ has joined #lisp
ebzzry has quit [Remote host closed the connection]
EvW has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
EvW has quit [Ping timeout: 240 seconds]
wxie has quit [Ping timeout: 240 seconds]
EvW has joined #lisp
xkapastel has joined #lisp
ggole has joined #lisp
DMX9 has joined #lisp
Bike has joined #lisp
wxie has joined #lisp
SGASAU``` has quit [Remote host closed the connection]
SGASAU``` has joined #lisp
DMX9_ has joined #lisp
jonatack has quit [Ping timeout: 246 seconds]
DMX9 has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
ebzzry_ has joined #lisp
amerlyq has joined #lisp
iAmDecim has joined #lisp
FreeBirdLjj has joined #lisp
jonatack has joined #lisp
oxum has joined #lisp
prince1 has joined #lisp
ebzzry_ has quit [Read error: Connection reset by peer]
prince1 has quit [Ping timeout: 256 seconds]
oxum has quit [Ping timeout: 258 seconds]
theBlackDragon has quit [Ping timeout: 252 seconds]
theBlackDragon has joined #lisp
DMX9_ has quit [Read error: Connection reset by peer]
EvW has quit [Ping timeout: 256 seconds]
aamukastemato has joined #lisp
iAmDecim has quit [Ping timeout: 240 seconds]
oxum has joined #lisp
EvW has joined #lisp
oxum has quit [Ping timeout: 256 seconds]
ebzzry_ has joined #lisp
oxum has joined #lisp
oxum has quit [Ping timeout: 240 seconds]
peterhil has joined #lisp
frodef has joined #lisp
arbv_ has quit [Ping timeout: 250 seconds]
iAmDecim has joined #lisp
EvW has quit [Ping timeout: 240 seconds]
arbv has joined #lisp
iAmDecim has quit [Ping timeout: 256 seconds]
EvW1 has joined #lisp
oxum has joined #lisp
shka_ has quit [Ping timeout: 265 seconds]
shka_ has joined #lisp
dddddd has joined #lisp
makomo has joined #lisp
bitmapper has joined #lisp
oxum has quit [Remote host closed the connection]
aamukastemato has quit [Quit: Leaving]
balavir has quit [Quit: leaving]
frodef has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
sonologico has quit [Quit: Leaving]
bendersteed has quit [Ping timeout: 272 seconds]
EvW1 has quit [Ping timeout: 256 seconds]
greaser|q has quit [Quit: HYDRA IRC LOL]
greaser|q has joined #lisp
terpri has quit [Remote host closed the connection]
wxie has quit [Quit: wxie]
wxie1 has joined #lisp
terpri has joined #lisp
oxum has joined #lisp
wxie1 is now known as wxie
oxum has quit [Ping timeout: 256 seconds]
iAmDecim has quit [Ping timeout: 264 seconds]
iAmDecim has joined #lisp
iAmDecim has quit [Ping timeout: 264 seconds]
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
prince1 has joined #lisp
gko has quit [Ping timeout: 265 seconds]
v88m has quit [Quit: Quit]
v88m has joined #lisp
prince1 has quit [Ping timeout: 260 seconds]
rumbler31 has joined #lisp
ebzzry_ has quit [Remote host closed the connection]
Oladon has joined #lisp
rumbler31 has quit [Ping timeout: 256 seconds]
oxum has joined #lisp
wxie has quit [Ping timeout: 265 seconds]
oxum has quit [Ping timeout: 256 seconds]
iAmDecim has joined #lisp
Frobozz has joined #lisp
whiteline has quit [Quit: Leaving]
whiteline has joined #lisp
sonologico has joined #lisp
clothespin has quit [Read error: Connection reset by peer]
xkapastel has quit [Quit: Connection closed for inactivity]
clothespin has joined #lisp
Jeanne-Kamikaze has joined #lisp
ssafar has quit [Quit: ZNC 1.6.5+deb1+deb9u2 - http://znc.in]
Nikotiini has quit [Quit: WeeChat 1.4]
Jeanne-Kamikaze has quit [Quit: Leaving]
Jeanne-Kamikaze has joined #lisp
Necktwi has quit [Read error: Connection reset by peer]
Necktwi has joined #lisp
<srandon111>
guys i wasa reading how to design programs... and i wanted to understand what it means to design data and functions in an orthogonal way so that they are independent
<srandon111>
can you make me an example of when these are not orthogonal and hence not independent?
Frobozz has quit [Quit: quit]
kmeow has quit [Remote host closed the connection]
kmeow has joined #lisp
<beach>
srandon111: It depends on what you mean by "data". Typically, an abstract data type has protocol functions associated with it, but there is no explicit definition of the data type in terms of its representation.
<beach>
srandon111: But if your representation shows in the protocol, then the dependency is there. That is something you would want to avoid.
FreeBirdLjj has quit [Remote host closed the connection]
<beach>
srandon111: For example, let's say you want to define the data type "editable sequence" and you decide to represent it as a binary tree. If then you have a functions left-child and right-child in your protocol, then it is blatantly obvious that you are representing the editable sequence with a tree.
<srandon111>
okok
<srandon111>
beach what do you suggest to learn lisp?
<beach>
srandon111: If instead you have only functions for inserting, deleting, and querying the sequence at certain positions, your protocol is now independent of the repersentation.
<srandon111>
is there something interactive?
<beach>
representation even.
<beach>
All major Common Lisp systems are interactive.
<beach>
The very definition of the Common Lisp semantics is "interactive" in that the semantics are defined by a suite of interactions.
<srandon111>
i mean interactive excersis something like 4clojure
<beach>
I am afraid I don't know what is. You may have to wait for someone else to answer.
<phoe>
hmm
<phoe>
Lisp Koans are somewhat interactive
<phoe>
but I am not aware of any interactive tutorial for the language
<phoe>
nothing with all the bells and knobs and whistles that you can run in your browser or anywhere.
<aeth>
Heh. It looks like the move to the impressive-looking SBCL 2.x got Fedora to finally update its SBCL from the ancient SBCL 1.4.14, at least in the upcoming release. https://apps.fedoraproject.org/packages/sbcl/
<aeth>
I guess one side effect of major version number bumps is Linux/etc. distros might care more.
d4ryus has joined #lisp
dale has joined #lisp
SGASAU has joined #lisp
<Ober>
👍
pilne has joined #lisp
cosimone has joined #lisp
cosimone has quit [Client Quit]
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
cosimone has joined #lisp
frgo has joined #lisp
SGASAU has quit [Ping timeout: 260 seconds]
ggole has quit [Quit: Leaving]
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #lisp
lucasb has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
oxum has joined #lisp
iAmDecim has joined #lisp
tutti has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
iAmDecim has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
izh_ has quit [Quit: Leaving]
CrazyPython has joined #lisp
kmeow has quit [Remote host closed the connection]
kmeow has joined #lisp
CrazyPython has quit [Read error: Connection reset by peer]
kmeow has quit [Remote host closed the connection]
kmeow has joined #lisp
EvW has joined #lisp
aamukastemato has quit [Ping timeout: 256 seconds]
CrazyPython has quit [Remote host closed the connection]
iAmDecim has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
baby_yoda has quit [Ping timeout: 250 seconds]
twelvemonkeys has quit [Ping timeout: 264 seconds]
narimiran has quit [Ping timeout: 264 seconds]
twelvemonkeys has joined #lisp
gravicappa has quit [Ping timeout: 265 seconds]
space_otter has joined #lisp
ear-the-art has quit [Remote host closed the connection]
ear-the-art has joined #lisp
FreeBirdLjj has joined #lisp
aamukastemato has joined #lisp
|Pirx| has left #lisp [#lisp]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<phoe>
aeth: is your Scheme-in-CL available for usage?
<aeth>
phoe: Continuations are tricky so it's been sort of a line-a-day sort of thing and even then I'm probably making some subtle errors that need to be addressed.
<phoe>
aeth: OK, thanks for the detail.
<aeth>
I've also noticed that my transformation is enough to deoptimize e.g. (defun scheme::+ (&rest numbers) (apply #'+ numbers)) where SBCL normally would optimize most of the overhead away. So I'm going to have to come up with a solution to efficiently transform all of the &rest stuff in Scheme (not just most arithmetic procedures)
<aeth>
I mean, worst case scenario I can write define-scheme-compiler-macro as a parallel to define-compiler-macro and essentially do it how you'd have to do it if you couldn't open code or inline +.
<aeth>
Or I could write an inlining system and hope the APPLY gets removed when inlining, which it should.
<aeth>
Or I could walk through the body and if it consists solely of an apply, I can do something fancy, etc.
<aeth>
phoe: at the moment, it's about 7000 cycles for arithmetic that would normally be 1000.
ldb has joined #lisp
<phoe>
aeth: impressive.
<ldb>
aeth: a typical solution is discriminate binary + and reduced + using some kind of rewriting
<ldb>
it is easy to conclude this kinds of &rest is a binary operator extended to folding with a unit object
<aeth>
ldb: yes, but I don't need to go that far, I just need to turn (R7RS::+ ...) into (CL:+ ...) of course with any additional overhead around it (e.g. continuations) although I suppose it's not quite that simple because someone in user code could do something like (let ((+ -)) ...) because Schemes usually don't have something like e.g. SBCL's package lock on CL
<aeth>
I'll probably just catch CL's TYPE-ERROR around +, too, instead of slowing down arithmetic with my own checks.
theBlackDragon has quit [Ping timeout: 265 seconds]
<srandon111>
guys do you think that nowadays all the shining features lisps have are also contained in other programming languages?
<no-defun-allowed>
No.
<srandon111>
like perl,python,ruby,and so on?
<srandon111>
no-defun-allowed, for example?
<srandon111>
if it is so cool why nobody uses it?
<ldb>
srandon111: nope, they don't have anything like CLOS
iAmDecim has quit [Ping timeout: 240 seconds]
<ldb>
R.I.P. ruby by the way
<phoe>
srandon111: CL still has pretty unmatched runtime introspection, interactivity, and debuggability
theBlackDragon has joined #lisp
<phoe>
and these three combo with each other pretty damn well
<no-defun-allowed>
Macros are either not present in most languages, or they're a bit of a joke because they only perform textual substitution (C) or the syntax is far detached from the data they process, leaving one with a line noise pattern matcher to make macros with (Rust, et al)
<aeth>
srandon111: CL comes with INCF that's like += and ++ in one (if the number isn't provided, it's like ++, otherwise like +=) but lacks *= but you can just do (define-modify-macro multf (&optional (delta 1)) *) (let ((x 2)) (multf x 42)) => 84
<aeth>
The point of a Lisp is that you don't have to wait on a new version of the standard for new syntactic sugar.
<ldb>
aeth: It sounds like your scheme would only do very direct translation to CL
<jcowan>
ldb: No, it does CPS conversion as well to support PTR and call/cc.
<aeth>
ldb: No, Pseudoscheme did a very direct translation to CL, hence the "pseudo" in Pseudoscheme. It lacked key features like call/cc iirc. Also, modern Scheme has syntactically and semantically drifted more in r7rs than in the days of r4rs (where e.g. hygienic macros were just an optional appendix)
<srandon111>
ldb, why RIP ruby???
<aeth>
ldb: Airship Scheme is intending to be a conforming r7rs Scheme so it has to introduce overhead where there is a semantic mismatch, but ideally no overhead if there is not.
theBlackDragon has quit [Client Quit]
<aeth>
That is, (* x y (+ z u v w)) should ideally just be (* x y (+ z u v w)) if possible.
<jcowan>
phoe: In my view, that II&D is a Good Thing, but it embiggens implementations that don't actually require it
<ldb>
aeth: yes, (* x y (+ z u v w))
theBlackDragon has joined #lisp
<jcowan>
which is why I wrote down a spec for CL-R, which lacks II&D at run time.
<ldb>
instead of (setq :G0103 x) (setq :G0103 (+ :G0103 y) what so ever
<ldb>
actually i think cl compiler could do better optimization to the ssa like form
<aeth>
ldb: well, yes, but I can't just say "OK, the input is (* x y (+ z u v w)) so the output is now (* x y (+ z u v w))" because of the continuation passing style and because, as I said, the user could just do (let ((+ -)) (* x y (+ z u v w)))
<aeth>
So I essentially have to deoptimize and then reoptimize it...
<ldb>
aeth: depends on if you'd like to produce readble CL code
<ldb>
FOAMlib is a good FP language to CL example if the readbility is not required
* ldb
FOAM from Aldor language and AXIOM CAS
sarna has quit [Quit: bye]
<aeth>
ldb: I mean, at the moment, I have a series of Common Lisp macros for this, so if you choose to put up with the reader mismatches (like t instead of #t and %scheme-boolean:f instead of #f), the result of reading a Scheme file will essentially just be readable CL code...
sjl has quit [Quit: WeeChat 2.2-dev]
sarna has joined #lisp
baby_yoda has joined #lisp
JetJej has quit [Quit: [Quit]]
<aeth>
And I can probably make an unholy mix of the Scheme and CL reader just for fun, i.e. supporting #t, #f, and some other Scheme things.
<ldb>
without %scheme-boolean:t?
<aeth>
I do have a %scheme-boolean:t in case someone thinks that they're being clever. It is, of course, just CL:T.
<aeth>
Scheme needs a separate F because #f and (list) are distinct, so one of them has to be something different, and I'm certainly not going to mess with the core list data structure.
<aeth>
Yet another detail that Pseudoscheme didn't have to worry about iirc
<aeth>
On the plus side, in CL, CL:NIL is usually just an ordinary symbol, so comparing to SOME-PACKAGE:F should be the same performance as comparing to CL:NIL
<ldb>
r
<ldb>
It reminds me the implementation of T Lisp used in Yale Haskell
<aeth>
The main disadvantage is any foreign call into CL needs to be distinguished between a procedure (NIL is expected to be the empty list) and a predicate (NIL is expected to be #f)
<phoe>
aeth: the other way I can think of is that CL calls always return one or the other if native CL code returns NIL
<aeth>
I might need to write something special specifically for GETHASH, since the second value is a predicate (NIL is expected to be #f) but the primary value probably shouldn't be treated that way.
CrazyPython has joined #lisp
<ldb>
Yale Haskell expects some kind of corece between Haskell's list and CL's list
<phoe>
that would be much less seamless though, but I don't know how to make it really seamless
<aeth>
ldb: Haskell is a lazy language so it's list is a typed, lazy list. I'd implement it with a struct or maybe a lambda.
<aeth>
Scheme's list is literally just CL's list
<ear-the-art>
linked list
<aeth>
s/it's/its/
<ldb>
aeth: but Yale Haskell use literaly CL's list for fully evaled list.
<aeth>
phoe: I mean, worst case scenario, Schemers get some extra NILs in complicated data structures.
<ldb>
The internal representation doesn't really matter
<phoe>
or they wrap CL function calls in something that manually (if (false? cl-retval) '() cl-retval)
tutti has joined #lisp
<aeth>
ah, 27 years ago...
<ldb>
aeth: Yale Haskell first implements a lisp dialect called T
<ldb>
then build the Haskell compiler on T
<phoe>
Yale Haskell - written between 1991 and 1993; was built from sources using CMU Common Lisp, Lucid Common Lisp, Allegro Common Lisp, Harlequin LispWorks, Kyoto Common Lisp. The last did suffer from performance problems, though. Compiled binaries were available for Sparc systems running SunOS 4.1.2 and Sparc 10's (sun4m) running 4.1.3. In the last release, the full functionality of X windows was made available
<aeth>
it is very weird and not at all the way I would do it, but it's understandable with the whole "27 years ago" thing
<ldb>
so it can run on both CL & Scheme
<phoe>
at the Haskell level.
iAmDecim has joined #lisp
oxum has joined #lisp
lowryder has quit [Quit: WeeChat 2.6-dev]
<ldb>
And it do has continuation implemented (for IO before IO Monad was invented)
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
<aeth>
Yeah, the whole "I would implement it with a struct" is assuming SBCL as the main runtime that people would probably prefer, which didn't even exist at the time. As opposed to trying to run it on every possible Lisp/Scheme.
oxum has quit [Ping timeout: 256 seconds]
iAmDecim has quit [Ping timeout: 256 seconds]
<ldb>
Someone has done a CLOS MOP based scheme though
<aeth>
Implementing Haskell via the CLOS MOP is probably not the way to get a fast Haskell implementation.
<ldb>
if one doesn't insist put the runtime on CL, it could still be fast
CrazyPython has quit [Read error: Connection reset by peer]
<ldb>
that CLOS MOP based scheme produce RISC asm as I can recall
ear-the-art has quit [Remote host closed the connection]
FennecCode has joined #lisp
Oladon has quit [Quit: Leaving.]
ear-the-art has joined #lisp
whiteline has quit [Remote host closed the connection]
whiteline has joined #lisp
aamukastemato has quit [Quit: Leaving]
frgo has quit []
mathrick has joined #lisp
ldb has quit [Quit: leaving]
frgo has joined #lisp
cosimone has quit [Ping timeout: 256 seconds]
payphone_ has quit [Quit: WeeChat 2.3]
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
peterhil has quit [Quit: Must not waste too much time here...]
peterhil has joined #lisp
payphone has joined #lisp
baby_yoda has quit [Remote host closed the connection]
oxum has joined #lisp
baby_yoda has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
oxum has quit [Ping timeout: 256 seconds]
Inline has quit [Ping timeout: 246 seconds]
SGASAU has quit [Remote host closed the connection]
SGASAU has joined #lisp
Involuntary has joined #lisp
jello_pudding has joined #lisp
Jeanne-Kamikaze has quit [Read error: Connection reset by peer]
baby_yoda has quit [Remote host closed the connection]