freenode/#lisp - IRC Chatlog
Search
18:40:08
inaimathi
It looks like `closer-mop` does the cross-platform imports I'm looking for here. Thanks!
18:41:32
inaimathi
(`specializer-object` works on anything; it returns the object of eql-specializers and the identity of other specializers (which should be a class reference))
18:45:14
makomo_
are there any other languages that have 2-argument versions of rounding functions such as FLOOR, CEILING, ROUND, etc.?
18:49:37
makomo_
excel also has a 2-argument version of CEILING for example, but the second argument is the "singificance" rather than the divisor
19:11:31
aeth
Other languages probably optimise floor(x/y) to do the same thing as (floor x y) in CL (assuming that / is defined similarly to CL's)... but most (all?) CLs don't optimize (floor (/ x y)) because (floor x y) exists.
19:12:41
aeth
what's great, though, is that (1) it's explicit and (2) you have plenty of options (floor, ffloor, ceiling, fceiling, truncate, ftruncate, round, fround)
19:14:24
pjb
And that they return 2 values, so you don't need to call two functions to get the quotient and the remainder.
19:15:52
aeth
But if you do want just the latter, you have both mod and rem available, which is rare. Check out the table to see comparable languages: https://en.wikipedia.org/wiki/Modulo_operation#Remainder_calculation_for_the_modulo_operation
20:26:00
jasom
ooh, this is interesting, cxml with klacks does it wrong, but cxml with sax does it right...
20:51:49
Bike
Is an implementation allowed to define documentation for things automatically if the user doesn't?
20:52:12
Bike
like for example, (defun foo (a b) ...), and then (documentation 'foo 'function) => "Function FOO (a b)" or something.
20:55:04
phoe
An implementation may drop docstrings at any time... but the spec is silent about the implementation *supplying* them at any time.
20:56:34
phoe
I believe that your implementation may call #'(SETF DOCUMENTATION) as a part of its DEFUN, DEFVAR, DEFGENERIC, ... with default values if no user-provided value is specified.
20:57:22
phoe
the accessor itself might decide to resort to some kind of default value when there is no user-specified documentation set.
20:59:05
jasom
Xach: here's a pie-in-the-sky feature request: a single command to generate a diff from what is currently in the directory for a project from what QL would put there if downloading it fresh
20:59:54
pjb
For used defined objects, I feel that if the user didn't specify a documentation then documentation should return nil.
21:02:01
jasom
Bike: usually implementations show what you suggest with DESCRIBE not with DOCUMENTATION
21:03:01
Bike
whether i can avoid having another slot in the environment by putting it in the docstring instead
21:27:09
combo1611
Having troubles installing Alegro CL on Ubuntu. bunzip2 is loaded and is extracting, but even with sudo, I am getting mkdir permission denied error.
21:33:36
phoe
combo1611: you should ask on the Franz support forums. #lisp@freenode is mostly about FOSS Lisp implementations.
21:36:55
combo1611
Oh, I'm not sure I even want Alegro, then. I'll search this FOSS term, thank you.
21:38:26
phoe
Steel Bank Common Lisp, a Common Lisp implementation that is open source and put in the public domain.
21:44:29
aeth
I would recommend trying SBCL, CCL, and ECL in that order, which is also the order of popularity on Quicklisp when you skip CLISP (no stable release in nearly 8 years!), ABCL (the JVM is in its own world), and the commercial implementations (LispWorks and Allegro). http://blog.quicklisp.org/2018/02/quicklisp-implementation-stats-for-2017.html
21:49:00
Shinmera
I own a root server, which is set up with several lxc containers. But this is getting offtopic.
21:55:57
combo1611
Nermind, I think that is a silly question. I guess I'm just thrown off by the newest version not available for Debian.
22:05:28
aeth
in 1.4.3: "bug fix: fixed heap exhaustion bug when consing millions of small objects" <- I think I might have encountered this before
22:09:11
phoe
If you're already an emacs user, then you might prefer to set up your own environment from bits and pieces.
22:12:51
combo1611
Mmm, I'll probably stick with the method in Practical CL -- besides the Allegro part.
22:13:46
combo1611
phoe: I see. That does sound like a nice download to have all that. Very helpful.
22:13:56
Shinmera
if I remember correctly PCL wants you to use lispbox, which is outdated and has been superseded by Portacle
22:31:50
combo1611
Dang! What a slick install Portacle was. SBCL was also very easy. Bravo CL community.
22:33:30
combo1611
Installs have always been tough for me. I'm starting to get the hang of tarballs.
22:35:38
whoman
sometimes it feels that the software we made to help us version stuff is when versioning became a problem
23:11:36
dTal
the JS people probably talk on some flashy web-based thing that uses 80% of your CPU and will be broken in 6 months
23:13:34
dTal
the idea that javascript, an admittedly impressive 3-week hack from someone who was told "Java" and wanted "Scheme", could actually be a serious programming language decades later, is a sign of computing culture's completely bankrupt engineering philosophy
23:14:28
jmercouris
I think we should encourage off topic conversation, it's part of keeping the community healthy and alive
23:15:10
dTal
remember when we all collectively regarded javascript accurately? When we are all like "oh, that warty language that runs in web browsers"? Remember that?
23:17:10
jmercouris
also programming the way we know it, interactively, is I guess much newer- to be fair
23:17:11
learning
plus you got 75% of people who will say two lines are the same length if everyone else does first. and those 75% of people will defend bad design.
23:17:25
dTal
Or rather, history is filled with languages that, while not perfect, were clearly on the right track, and were then completely abandoned
23:18:10
learning
if you released a program that had a UI as bad as programming no one would use your program
23:18:39
pjb
jmercouris: sure, theres even a day of the year for her: https://www.daysoftheyear.com/days/ada-lovelace-day/
23:19:53
dTal
the trouble is that the computing world does not regard ergonomics a top priority, and programming barely regards it at all
23:20:33
dTal
hell, Python invented the revolutionary idea that maybe a language shouldn't totally suck to use, and look at it now even though it's slow and warty and unprincipled
23:22:16
learning
you can do it lisp, but we dont. for good reasons, but you can't discount the value of familarity and simplicity in python
23:22:20
dTal
now Python pisses me off tremendously but it's almost always the path of least resistance
23:22:20
pjb
Indeed, you'd go at least as far as Basic to find a language that sucks as much as Python.
23:22:22
whoman
about "nerds make the coolest shit" - no one is selling that. just saying that if you want ergo, pay money
23:23:07
dTal
Python sucks and does not suck. You have to admit it does something right, or it would not be so popular.
23:23:22
pjb
But it wasn't worth the pain to make a new language and a whole new ecosystem to such that much really! What a shame. Even Ruby which sucks a lot, sucks way less than Python!
23:23:26
whoman
video games arent exactly "the coolest shiz" after reaching a certain level of maturity
23:23:36
learning
well i think part of being a lisper is looking at other languages for inspriation because you know you can do it in yours
23:24:34
whoman
in bible times babylon worshipped 'baal' aka "the lord of the flies" because their "sacrifices" (garbage) would be accepted based on flies/maggots/etc
23:25:11
whoman
observing the last couple of months, i think lisp promotes being social, at least online. i dont think that is a "problem
23:25:21
pjb
Those languages, ruby, python, clojures, etc, are just me-too languages that have had success.
23:25:52
whoman
the more "ego-centric" or "ego-filled" languages are easier for the flies to be attracted to and identify with.
23:26:39
dTal
whoman: social in the sense of talking about Lisp, but not neccesarily in the sense of writing code that works together
23:27:45
dTal
A big problem in the programming language world is how fans of a language embrace their chosen language's shitty parts in a tribalistic way
23:28:45
pjb
Not at a given time. But this may be the number programmer who have used lisp seriously at one time or another.
23:29:10
whoman
for myself personally, i like to draw the parallel of the meditating and chanting monks of the world -- compared to 'regular' people -- righteousness is more concentrated or whatever, but i like to think it holds up the world.
23:29:10
dTal
For example APL variants should be vastly more influential than they are. They aren't because APL fans are addicted to unreadable syntax. It makes them feel clever.
23:30:06
pillton
The biggest problem in the programming language world is that the runtime environments don't compose. This causes this conversation to occur over and over again.
23:30:10
pjb
However unicode should help APL, recentering on the glyp-based notation. J was really to wild for me. :-)
23:30:11
whoman
dTal: people get that way with spoken language too. i see it often, where a person excludes themselves further from their immediate family/neighborhood/culture by using more private and meaningful-only-to-me language
23:32:01
phoe
In production code, they are meant to be eliminated, and the people who put them in there are meant to be shot.
23:32:26
dTal
_death: you got me, I'm a fan of many aspects of Lisp but I'd hate to use it for my daily work
23:32:40
whoman
maybe its like religion - we serve a higher purpose, whatever that is. stepping back from our personal persuits - for sports fanatics, wearing their team's color, i wonder how many decide its their favorite color(s), or wear them despite/inspite of?
23:33:41
dTal
My perfect language would be something like Axiom - a strongly typed, highly symbolic, syntax-heavy language written in Lisp
23:34:12
dTal
Lisp, or something very like it, should definitely be the implementation language for everything else
23:34:47
whoman
depends what it is, i think; languages are tendencies toward certain mental concepts
23:36:57
whoman
dTal: ok i believe you, cant search for examples right now - looked at the API, seems cool. makes me think of Clean/Curry/Mercury/Coq
23:56:50
pfdietz
sbcl, abcl, and ecl support package local nicknames. cmucl, ccl, and clisp do not. I don't know about Allegro CL or Lispworks.
23:58:30
pillton
whoman dTal: There is precedent here with COM. The fundamentals of COM are incredibly simple. The COM specification did give rise to a marketplace of language independent components. I don't know why people stopped using those fundamentals.
23:59:10
whoman
pillton: heh, i tried some COM stuff, it seemed very complex; idl interface files and whatnot
0:00:05
pillton
whoman: Like I said, the fundamentals are very simple. You are talking about something higher level.
0:01:38
pillton
whoman: "IDL interface files". You don't need IDL interface files to understand the fundamentals of COM.
0:02:55
pfdietz
Technical churn like that is a way to get age discrimination without breaking the law.
0:06:09
pjb
In the mean-time it means that in practice, you always have half the programmers with less than 5 years experience, ie. half the programmers are always newbies.
0:06:40
pjb
This is why you have so much new dumb technology, stuff like perl, python, ruby, node.js, etc.
0:07:58
pjb
So the seasonned professional can avoid churn by realizing the spiral, and either follow the movement, or wait for the next cycle. :-)
0:12:24
_death
pjb: I found that many people assume you're either a web developer ("frontend or backend?") or a mobile developer ("android or ios?").. funny stuff
0:14:51
fouric
I'll poke you if I find issues or anything - I think that I'm just going to switch back to SLIME.
0:17:41
fouric
Nothing, but that's more a product of me not ever having sat down and read through the slime documentation.
0:18:46
_death
slime has documentation? :D .. well, I know it does.. and likely have read it when I started using it.. but the real documentation there is the source code
0:19:23
fouric
the energy required to set up a mental representation of a non-trivial codebase is significant
0:19:58
_death
also, it's lisp.. so you can just evaluate things in the repl to get an intuitive feel
0:22:10
mfiano
fouric: They are the same as the SLIME layer for the most part. You can also use Emacs style C-c C-c (not mentioned)
0:40:32
mfiano
fouric: What I mean to say is you aren't losing anything from the slime layer, only gaining
0:46:06
jasom
Shinmera: it looks like plump is for xml-ish documents rather than being a true xml parser
1:00:03
MetaYan
beach: trivial-garbage mystery solved. lispbuilder includes an old version of trivial-garbage. Having lisp-builder in local-projects caused that version to be used.
1:02:32
MetaYan
phoe: trivial-garbage mystery solved. lispbuilder includes an old version of trivial-garbage. Having lisp-builder in local-projects caused that version to be used.
1:38:19
MetaYan
Xach: Thanks for the ql:where-is-system tip anyway. Here's what it shows in this case: http://termbin.com/gwnr
1:42:02
learning
ah so when i want to use lisp's if statement in other languages i just gotta google ternary
2:19:40
aeth
In CL, return values and expressions make the most sense, like having if return a value and use the result
2:20:14
aeth
Using ternary in other languages is rarely as clear as using if in Lisp ime if you directly translate between Lisp and some other language.
2:21:04
aeth
Lisp is just really good at working with expressions where many other languages look like a mess when you can try to write what seems like the exact same thing.
2:25:17
aeth
(Of course, if multi-line expressions are painful in other languages, maybe the problem is with the syntax of the other languages.)
2:38:44
aeth
The main reason I wrote define-shader to translate from s-expressions to GLSL is because I kept slipping up in the syntax by switching back and forth between GLSL and CL and it was getting annoying.
2:51:56
attila_lendvai
this seems to do the trick: (setf uiop:*uninteresting-conditions* uiop:*usual-uninteresting-conditions*)
3:18:01
beach
flip214: I think I'll pass on the Alexandria issue. I have too many other things to do at the moment.
3:24:31
fouric
mfiano: would you, or anyone else, happen to know how to override evil-cleverparens' bindings?
4:23:31
krwq
got question, how do you convert string to utf-8 bytes? I've tried this but flexi-streams seem to be ignoring format: https://pastebin.com/DGkUCLnB
4:24:33
beach
If there is no library to do it, you would just have to apply the rules of UTF-8. They are not that complicated.
4:26:41
beach
ACTION now fully expects a complaint that the Common Lisp standard is deficient, since it doesn't define such a function.
4:33:49
Bike
if i understand the flexi streams manual correctly, in memory streams are binary, and don't have external formats so you can't use characters
4:35:09
krwq
beach: Bike: do you know any library providing a way to convert string to utf-8 without allocating new buffer (= using preallocated buffer)
4:36:43
Bike
(babel:string-to-octets "hello world" :encoding :utf-8) => #(104 101 108 108 111 32 119 111 114 108 100)
4:42:17
nydel
i'm curious why MOD and FLOOR both exist in any implementation i can think of. MOD in my mind being (CDR (FLOOR X)) ... is MOD actually quite a different program than that? documentation in sbcl or clisp offers little on how they are related.
4:46:36
beach
nydel: There are several possible explanations. One (very likely) is that MOD exists for reasons of backward compatibility with other Lisp implementations.
4:46:43
Bike
the clhs entry on mod says: "mod performs the operation floor on number and divisor and returns the remainder of the floor operation."
4:48:24
beach
nydel: Another one is that it is more costly in terms of performance to manipulate multiple values, so MOD is probably faster than to use FLOOR and then take the second value.
4:49:00
beach
nydel: And if you were right that FLOOR returns a list, then MOD would be WAY faster, because memory allocation is expensive as well.
4:50:26
nydel
i somehow have taken clhs out of my things-i-can-immediately-reach circle, i need to remedy that, thanks Bike
4:50:45
beach
But yeah, there are two common competing discussion here in #lisp. 1. Why is this very special function that I need not in the standard. I mean, almost everybody needs it right. 2. Why is this general function in the standard when the effect can easily be obtained form combining other functions in the standard.
4:52:34
beach
I am guessing that neither of these two discussions exist for languages that don't even have a standard, which seems to be what many people use these days. Somehow, having a solid, well tested, reliable, fixed standard, seems to be a disadvantage to a language.
4:54:30
nydel
but beach in a brighter pov my meaning was to find out "what's the thing i usually look at for a question like this?" and the answer was CLHS ... i have no opinion one way or the other on whether one/both exist, the question was about where i was failing to keep my documentation complete
4:55:36
nydel
i never feel that commonlisp is lacking in documentation, and that is largely i would believe because of it having a standard.
4:57:27
nydel
i definitely see the two points discussed in circles all over the place and never directly
4:57:48
nydel
enter pillton to directly address it right as i claim it's never directly addressed :)
4:58:42
beach
Both types of complaints, by the way, are typically aired by people who know nothing about language design, nothing about language implementation, and nothing about the history of Lisp.
4:58:49
pillton
Who needs these things to promote interoperability? #+(me) #+(and) #-(others) all the way down.
4:59:08
krwq
nydel: btw if you use emacs you can move your cursor on the symbol in slime and C-c C-d h
5:00:38
nydel
krwq: thank you - i haven't had a question like this in a while (i rarely use #'MOD but it came up in a japanese lisp book - a predict the day of the week function, you get it) so i forgot it exists(CLHS) .. good to have the keystrokes, thank you!
5:01:36
nydel
ok so pillton are you going to fork sbcl to sbcl-unstandardized-b'tches! or is beach gonna handle that
5:03:48
pillton
nydel: It took 10 years for me to find things in CL that I annoy me enough to transition from apathetic to emotional.
5:05:56
krwq
I'd be nice if beach's implementation was generic enough so that compilers can use it instead of their own
5:06:36
nydel
would be interested to look at beach's lisp if it is in some kind of version control repo or tarball etc
5:14:38
beach
krwq: The Cleavir compiler framework is meant to be just that. In fact, it is already used by Clasp for its main compiler.
5:44:12
krwq
beach: any ideas why is this (let ((.foo))`(,.foo)) saying that `foo` is unbound? (I know I can add space between comma and dot and that this is a bad idea to name vars like that)
5:51:14
fouric
beach: do you have a minute to elaborate on what "implementation-independent compilation framework" means (context: SICL)?
5:52:03
beach
It means that the compiler is written so that it can be customized to implementation-specific details.
5:52:26
beach
Otherwise, it is common that implementation-specific details are scattered all over the compiler source code.
5:53:08
fouric
(I'm just trying to find a few concrete examples of "implementation-specific details")
5:53:18
beach
But take the situation where the compiler needs to interrogate the environment for information about variables and functions.
5:54:14
beach
The Cleavir compiler defines a CLOS-based protocol for doing that, and it explains what an implementation must do to customize that protocol so that the Cleavir compiler can use it.
5:55:32
beach
Furthermore, the Cleavir compiler uses an intermediate form called HIR (for High-level Intermediate Representation) that is independent of how objects are represented in a particular implementation. On this representation, we can do several transformations such as type inference, escape analysis, etc.
5:56:08
beach
Again, your typical Common Lisp compiler will have object-representation details scattered all over it.
5:57:34
beach
There are a few instances where HIR (and also the preceding representation: AST) need to be customized for each implementation, but again, there are CLOS protocols put in place to make this customization straightforward, using auxiliary methods on generic functions.
5:58:14
beach
But take the SBCL compiler, for instance. It couldn't do something like that as easily, because it was designed not to use generic functions, for reasons of bootstrapping.
5:58:25
fouric
Hm. Let me see if I'm getting this right: would the following example be correct: Cleavir providing an implementation of FUNCALL that calls generic functions to get the symbol-function from a symbol, and each compiler implements the generic function that does so?
5:59:36
beach
Cleavir defines a generic function called FUNCTION-INFO that it calls when it needs information about a function (whether it's a macro, whether it has a compiler macro on it, its type, etc).
6:00:11
beach
One of the arguments to FUNCTION-INFO is a function name, and the other is an object representing a global environment.
6:00:59
beach
Implementations customize this generic function by defining a method on it that will specialize on some implementation-specific environment object, and then call the implementation-specific function to build the information that the Cleavir compiler needs.
6:01:42
beach
So, for example, SICL doesn't store the function in the symbol object, but instead in the environment objects, so the methods are very different in SICL and (say) Clasp.
6:04:28
fouric
I don't understand what "environment objects" are, but I think that I can guess at the relevant bits well enough to understand Cleavir's purpose as a whole.
6:06:09
beach
SICL has an explicit object that store the environment information, but most implementations scatter this information all over, like the function being stored in the symbol, and the type information in some hash table, etc.
6:08:39
beach
Mainly because nobody thought of a technique that have the same performance but a more modular environment object. Hence the paper. Also, for historical reasons.
6:08:45
fouric
...although this paper makes it sound like you implemented SICL's "global environment as first-class object" approach without much of a performance hit
6:09:01
beach
When people see SYMBOL-FUNCTION they immediately think the function must be stored in the symbol
6:10:30
beach
So, an implementation that does not have an explicit object for the environments will customize Cleavir by creating a dummy environment class that is only used for generic-function dispatch, and the method specializing on that class will just call the implementation-specific functions to gather the information.
6:13:59
beach
I know of no other Common Lisp compiler that has been specifically designed this way, which is why I call Cleavir an implementation-independent compiler framework.
6:14:47
fouric
Does Cleavir do any (native) code generation, or is that all deferred to the implementation itself?
6:15:12
whoman
afaik the GL world calls it a "reference implementation" - like how Mesa is sometimes used
6:15:34
beach
At the moment, it is up to the implementation. Mainly because the only client implementation is Clasp, and it already does its own code generation.
6:16:46
beach
fouric: It gets harder after HIR. The next layer is MIR (Medium-level Intermediate Representation) where object representations are exposed and address calculations are made explicit.
6:17:59
beach
fouric: The MIR layer requires way more customization than HIR, and it has not all been worked out. But we need it, because we plan to implement optimizations in MIR as well.
6:19:18
beach
I think I will first hash out MIR for SICL, and then see what generic function are needed to generalize it to other implementation.
6:20:10
beach
Oh, and MIR may also depend (at least somewhat) on the backend, like what kind of instructions the processor is capable of.
6:20:50
aeth
Is there any advantage to actually creating an object at compile time in a macro and using make-load-form instead of essentially generating code that will at run time create the object?
6:23:06
aeth
I essentially have an elaborate group of things that's done entirely at compile time, and then is just constant data by the time run time comes
6:28:08
aeth
fouric: Describe the hardware itself in Lisp, now that RISC-V exists as an open instruction set.
6:29:44
aeth
There are multiple efforts to generate JavaScript and multiple efforts to generate GLSL. So generating VHDL and/or Verilog probably wouldn't be too hard.
6:30:45
whoman
=/ curious why no other llvm efforts? theres several for a lot of langs, i notice today