freenode/#lisp - IRC Chatlog
Search
0:49:34
stylewarning
rambling about static types in lisp https://github.com/tarballs-are-good/coalton/blob/master/thoughts.md
0:53:57
aeth
I use static types (and similar things) a lot in my game engine. And there are drawbacks to static types, they just seem to make sense a lot in the core of a game engine.
0:54:21
aeth
on the other hand, in that same engine in functions called from defmacro everything's pretty dynamic
1:00:35
aeth
What I like about CL is that it's a messy mix of everything all in one language, so you just use whatever's most convenient for the problem.
1:01:52
stylewarning
aeth: I have often said something like that, but I think that viewpoint would benefit from more refinement.
1:05:20
aeth
Well, I think the downside with CL is that its weaknesses are things that have gained popularity since the mid-90s. Stuff you see in Haskell or Rust or Go, etc.
1:06:41
stylewarning
aeth: I think a "weakness" that is present in the current ecosystem is just lack of completeness, comprehensiveness, or robustness.
1:07:04
aeth
You even see stuff in Java that CL is lacking, like a rich standard library full of lots of built-ins like queues, sets (other than the very weak lists-as-sets), etc.
1:07:21
stylewarning
Maybe I want to write in a functional fashion. What are my options? Use a mishmash of Alexandria, FSet, and a few other things?
1:07:55
aeth
What you miss with custom data structures is (1) whatever the library author (or you) forgot to add and (2) any kind of convenient way to use them
1:08:40
stylewarning
I think 1 and 2 are really, really important. 1/2 are the reasons people use a library/paradigm/whatever.
1:09:26
stylewarning
"You can do functional programming in Lisp because it has all of the fundamental primitives you need." -- generally not convincing enough for me to employ a functional paradigm, because it's asking me to roll out and "complete" the paradigm
1:09:41
aeth
Pure FP in CL is almost as bad as pure FP in JavaScript, btw. You lose any kind of efficiency that you'd have in a language like Haskell.
1:10:20
stylewarning
Anyway, this is the point I'm making and what I meant about refining that viewpoint.
1:10:46
stylewarning
You can access a lot of "primitives" to lots of paradigms/ways of doing things, but they're often just not full featured or complete or 100% integrated
1:11:02
stylewarning
But that's almost never Lisp's fault, and it's almost never the compiler writers' faults.
1:11:19
aeth
CL's pretty much still #1 in dynamic OOP, although that's kind of out of style at this point
1:14:08
aeth
stylewarning: I'd go farther and say not only can you do lots, you can do pretty much anything in CL through elaborate enough macros (or reader macros), but it won't feel integrated and it probably will be via an undocumented, incomplete library
1:15:03
aeth
At a far extreme you could have a reader macro with a new syntax compile down to an implementation's inline-assembly or something.
1:19:03
aeth
at least at the state it's currently in, I'd personally say Lisp is more like a language for writing functional (or at least declarative) languages than a functional language
1:20:08
aeth
I'm actually surprised there aren't more languages like Shen that have a CL backend. (Although, personally, I'd *just* have a CL backend rather than have like 20 backends like Shen does)
1:23:47
asarch
Well, I am reading at Sonja E. Keene's book (Object-Oriented Programming with CLOS) that for each Common Lisp data type, there is an equivalence CLOS class for that
1:29:10
stylewarning
asarch: It sounds like you have a wrong model of what Lisp is like or what its syntax is. You'd benefit from reading PCL.
1:33:14
asarch
When I was learning to develop web applications with Perl with Catalyst, I found that Catalyst uses the new object system of Perl called Moose which is based on Class::MOP which it uses the Meta-Object Protocol
1:34:05
asarch
When you declare a new class with Moose, you can actually define the data type for each slot: has 'x' => (is => 'rw', isa => 'Int');
1:38:13
stylewarning
asarch: so why would you suppose a class has anything to do with "facilitating" operations on a slot?
1:39:01
stylewarning
Shouldn't a class more so be for defining what slots are associated with some data structure you're creating?
1:42:00
asarch
In the book there is a table with the precedence of classes corresponding to Common Lisp types
1:42:37
stylewarning
asarch: Sorry, it just seems you're saying a collection of random things that you're maybe reading about. I'm not sure what you're actually trying to figure out / ask / discuss with the channel.
1:44:15
asarch
Well, reading the book I thought I could use the class INTEGER just I could with the class String in Java
1:44:32
stylewarning
And why would you expect that? Because Lisp and Java both take 4 letters to spell?
1:45:23
stylewarning
Object orientation in Common Lisp is quite different from other languages. My advice to you (aside from reading PCL) would be to dispose of, or quarantine, what you know about object orientation from other languages while learning about it in Lisp.
1:46:17
stylewarning
Analogies are rarely going to carry over well. If you are a fan of analogies, then PCL would be a good book for you, since it was written by somebody who is incidentally also an experienced Java programmer.
1:49:34
stylewarning
You must recognize that Lisp is quite a unique and different language, and that you have to invest in learning it in its own right, and not be fooled into believing that understanding Lisp is merely a translation of some other language you're already familiar with.
1:55:07
asarch
Since Lisp and Smalltalk both inspired each other, I thought with CLOS was the same :-(
3:14:55
beach
I see another long and pointless discussion about what Common Lisp ought to have but it currently doesn't.
3:16:42
beach
More importantly though: 2. Suggesting random changes to the language without knowing the consequences to implementations reminds me of how languages are designed by benevolent dictators. They often end up being impossible to implement efficiently.
3:18:26
beach
Designing a language requires deep knowledge about compiler design, garbage collection, object representation, generic dispatch, etc.
3:19:44
beach
And in the case of Common Lisp, it also requires deep knowledge about how ALL the current features fit together. Changing some random feature is very likely going to break many other things.
3:26:05
beach
Oh, wait! Crap! Now I am going to be accused of "elitism" again, i.e. requiring that people who design languages know something about language design.
3:53:50
beach
You can add an account interactively and then use the command "write organization" to save the entire state of things.
3:54:24
edgar-rft
beach: ...about elitism - I found that it's important to be *aware* of my own stupidity because being aware of it it can include it into my planning, and my plans work *much* better since I take my own stupidity into account. That's one of the secret how life works.
3:56:56
beach
edgar-rft: Another trick I use: I am VERY careful about assuming that I know ANYTHING about a particular domain. That is why I rarely participate in discussions about isolated changes to the language. I must go away and think VERY HARD and for a VERY LONG TIME before I am convinced that some such suggestion is possible, let alone desirable.
4:01:40
beach
I read somewhere that people with a low level of knowledge (or was it intelligence, I forget) often significantly overestimate their level, whereas people with a high level often underestimate theirs. This is statistics, of course, so no conclusion should be drawn with respect to an individual, nor should any causality be inferred.
4:02:16
edgar-rft
It's rarely never a good idea to think about isolated things, but the problem is that noone knows really *all* consequences, so the trick is to find a reasonable compromise. But judging is hard because we all have only partial knowledge.
4:04:53
beach
That is why, for language design, I have decided to limit myself to WSCL, i.e., I am just aiming for more specified behavior where the Common Lisp HyperSpec does not specify it. That way, I can leave features alone that I am not sure of, and only work on those that I am certain will work out.
4:29:00
beach
I have recently taken an interest in phenomena in psychology and behavioral economics with respect to how these phenomena influence software development.
4:50:22
jack_rabbit
I don't use any c bindings in *my* application. I can't speak to which libraries use them.
5:30:34
jackdaniel
no-defun-allowed: McCLIM does not use C. some of it extensions might, but none of them is enabled by default
5:39:55
jackdaniel
regarding discussing changes (possibly unwise): it is one of many ways to learn to know better; that's more a question of curiosity not stupidity
5:40:16
jackdaniel
unless we take, that someone has to study for n years before he is allowed to have his own convictions about a subject (and they still may be wrong!)
5:40:17
beach
18.05.04:05:43:21 * theemacsshibe[m] gives magic GNU🦄PONUT a vegetable burger she got from the barbeque
5:40:43
no-defun-allowed
annoying things about computing classes: 1. python 2. it's an "all boys" class and if i dare say anything i'd be made fun of
5:43:52
no-defun-allowed
i used a lambda once with map cause [.. for x in ...] is too long for me and that led somewhere apparently
5:44:41
no-defun-allowed
he does physics and maths so i might suggest ML to him, i know enough of it. he's seen lisp and he can't quite parse it yet
5:46:27
beach
It is interesting to me that mathematicians and scientists, who are "perfection oriented" in their domains, are often "performance oriented' (or have a "closed mindset, as Carol Dweck says) when it comes to their computing tools.
5:47:10
no-defun-allowed
i'll be honest, sometimes what he knows is scary. for example, he knows tag bits are a thing
5:48:46
no-defun-allowed
well, not hardware stuff. not sure how cpython does it but sometimes (especially on x86_64) you put it in the pointer and it's okay cause of address space and alignment trickery
5:50:11
JuanDaugherty
right in this time of the overwhelming predominance of commodity architectures there are no real machines with tag bits
5:55:21
aeth
People want a fun little toy program that they can write and see immediate results in and Lisp doesn't really have those frameworks yet. Work on helping one of those get mature.
5:55:52
aeth
(Well, I mean, I can name half a dozen of them, but not ones I'd show to a stranger without spending a few weeks contributing documentation to first)
5:56:17
no-defun-allowed
if i do, he'll lose faith in python and there'll be 25 more newbies asking me crap though
5:58:32
no-defun-allowed
i already get enough "hey no-defun-allowed, please check my code" questions so for me, the selfish weenie, that's not convenient
7:17:01
jackdaniel
you may modify various flags in c-toolchain from cffi (which is what groveller use)
7:17:54
jackdaniel
afair when cffi adds its own flags it preserves ones already specified in dynamic variable
11:48:24
mrottenkolber
For some reason I can’t get postmodern to print its timestamps in SQL statements anymore
11:54:28
mrottenkolber
Shinmera: while I am here, do I remember correctly that you have a lib for html sanitization I could use instead of sanitize?
11:55:29
Shinmera
You are correct in the sense that my HTML parser is lenient and will chug anything. It will always produce valid HTML or XML when serialising its dom, so you can use it to sanitise.
11:55:59
Shinmera
Note however that Plump does not follow the HTML5 spec on parsing invalidly formatted content, so the results might be slightly different from how a browser would interpret it.
11:56:27
figurelisp
Pardon my ignorance but where can i find how a function is internally implemented in Common lisp for ex let's say implementation of set-difference
11:58:19
phoe
figurelisp: basically, if the function is from package COMMON-LISP, then it's implemented internally in CL.
11:59:24
phoe
I also grep the sources. For SBCL, for example, https://github.com/sbcl/sbcl/search?q=%22defun+set-difference%22&unscoped_q=%22defun+set-difference%22
11:59:39
phoe
This gives me https://github.com/sbcl/sbcl/blob/aa8ddb5469ac3499d8a1bc6fd7a0555525046e6c/src/code/list.lisp#L1055
11:59:47
figurelisp
yes i used M- and it says (set-difference list1 list2 &key (test #'eql) test-not)
12:00:25
phoe
in non-emacs notation, move your point over the symbol in question, press alt, then hit period, release alt
12:00:27
figurelisp
although i don't understand, is this how the code of set-difference is written in implementation of common lisp?
12:03:50
mrottenkolber
Shinmera: amazing, thanks! might be able to drop the cl-xml2 dependency this way
12:08:25
figurelisp
phoe: TBH i don't remember. I followed some guide online which told to download sbcl and slime
12:09:59
Shinmera
You may also be interested in https://portacle.github.io/ . It includes a reference page for keyboard shortcuts and Emacs explanations.
12:11:39
figurelisp
Shinmera: I looked into portacle but i wanted to install sbcl and slime by my own so I tried
12:12:27
xificurC
phoe: minor nitpick, don't suggest which but `command -v`, the latter is faster and, more importantly, correct
12:16:31
Shinmera
xificurC: Note that handler-case by necessity unwinds, and thus the original stack trace is lost.
12:16:32
xificurC
figurelisp: no, there's a command called command :) Don't use `which sbcl` but `command -v sbcl`
12:17:36
xificurC
this isn't a spot where I care too much if the stack unwinds, I just need to do something before resignaling
12:18:37
phoe
and then the handler will decline to handle the condition, at which point the execution will continue
12:20:23
Shinmera
handler-bind and handler-case will have different semantics for the call to bar though
12:21:18
xificurC
you mean by unwinding the stack e.g. specials might have changed? right now bar is just (format *error-output* ...)
12:21:21
Shinmera
This can be important if BAR for instance assumes that cleanup or other actions have taken place that would happen during unwind.
12:22:30
phoe
handler-bind is a construct useful when you need to execute code when a condition is signaled
12:22:39
phoe
handler-case is a construct useful when you need to get the hell outta there when a condition is signaled
12:23:25
phoe
in yet other words, handler-case always transfers control outside of the signaling form, where handler-bind doesn't necessarily do that
12:23:39
trittweiler
Be aware that declining handling it means that another handler higher up the stack will be tried next. If you don't want that you need a continue or a muffle-condition restart and invoke that from the handler
12:24:14
xificurC
in other words handler-case is for those who only know exceptions from other languages and handler-bind is for the brave :)
12:24:51
Shinmera
phoe: The important part is that handler-bind executes /on top of the stack/, while handler-case /unwinds the stack/
12:25:29
phoe
handler-case is analogous to try-catch if all of your conditions are signaled via #'ERROR
12:26:15
phoe
if you only use #'ERROR and HANDLER-CASE, then you have a dumb exception system like the one in Java or C++