freenode/#lisp - IRC Chatlog
Search
21:44:00
aeth
jmercouris: Setting to NIL doesn't remove it. It makes it (values NIL T) while removing it makes it (values NIL NIL)
21:45:39
Bike
you need out of band signaling, yeah. nowadays there are a couple languages that use option types for it
21:48:30
Shinmera
Whether it's the right time or not all depends on your confidence / decision about how fixed your test is.
21:49:11
stacksmith
jmercouris: Many different opinions on that... I would just make functions you can test from REPL, and when things get out of hand, write tests. I find that I change things around too much in the beginning to bother with formal tests.
21:49:30
Shinmera
If you have a public interface that users should use and you don't want to break compatibility -- that's a perfect indicator that they should be test-covered.
21:49:51
jmercouris
Shinmera: Well, there is a public interface that users use, but I don't mind breaking their compatibility in the name of progress
21:50:13
jmercouris
I'm sure linus would scream at me until he is blue in the face, but I have at most 20 real useres
21:50:29
jmercouris
and it is not that I want to make them regret using next, but that we need to improve the api, and I'm sure they'd understand
21:51:12
jmercouris
I really want to improve my interface to the GUI, this is something I've been thinking about for months and months
21:51:33
jmercouris
I'm too tired to explain now though, I'll talk about it tomorrow, and hopefully someone has some good ideas
21:51:55
jmercouris
aeth: I don't worry too much about that, I only want to test the core CL only parts
21:54:56
Shinmera
While all of my published projects have docs, most of them don't have tests. Which is unfortunate, but yeah.
22:00:05
jmercouris
the restarts you get are kind notifications from the system that you've discovered a feature
22:00:28
jmercouris
they let you know "by the way, doing action x results in this", and then you may decide whether you want that feature or not
22:03:11
_death
there are Lispy references to developing a program in a debug session.. they remind me of writing programs using debug.exe
22:05:41
stacksmith
_death: design decisions are mostly wrong in my case. Heck, more often than not I find out that the problem I am solving is not _the_ problem in the first place...
22:06:50
stacksmith
I've been careful to avoid making design decisions and 'listen to the wind'. When things get too complicated, I find that I was just very wrong about my model, and wind up replacing gobs of code with 10 lines...
22:07:34
Shinmera
I usually get smaller libraries done first try, but bigger systems always need at least 3 rewrites before they're adequate.
22:08:22
Shinmera
Radiance had, if we count previous framework iterations, 6 rewrites, most of those complete from-scratch new starts, including everything I wrote to work with it.
22:10:04
jmercouris
as you learn more you think "ah, I could have done it that way" and that changes the way you think
22:10:17
Shinmera
Iteration is part of any design process, and with code you need to be so detailed that there's at one point nothing else to do but to write the actual code for it, which in turn becomes part of the design process.
22:10:44
stacksmith
The more you can actually act on the 'ah', the more likely you will come up with the right solution.
22:11:13
stacksmith
I've been involved in too many stupid projects that were done a certain way because the cost of rewriting was too high.
22:12:18
Shinmera
Not to say that rewriting is always a good idea, it's often not, but it sometimes is.
22:12:35
_death
I found rewriting to be beneficial in many cases, but I guess it depends on who does it ;)
22:12:45
stacksmith
It's like optimization, except the other way around. Premature rewriting is much cheaper.
22:18:32
stacksmith
Only if it makes sense. In some cases you need to guarantee that some commands do exactly what they always do...
22:21:53
Bike
I thought this was already emacs like so you can just redefine all the key bindings/actual interface.
22:23:21
jmercouris
you could redefine whatever you like, but maybe you just want to do something really trivial
22:25:05
stacksmith
Then you need a way to remove your hooks, seach hooks, and otherwise manage them...
22:25:51
jmercouris
I already have spent time thinking about all those faculties, and they noe exist in my program
22:26:24
stacksmith
jmercouris: With all due respect to emacs, I would be careful using it as a shining beacon of a scalable user-interface...
22:27:02
jmercouris
I have all the time reasons to be angry at it, but I don't think hooks is one of them
22:28:03
stacksmith
Well, the entire problem of a pile-up of features from various sources is an issue. The interaction of hooks along with their sequence makes for very painful bugs.
22:28:33
jmercouris
if I am feeling really ambitious I can do a :depends-on type thing for each hook
22:29:10
stacksmith
But for tasks that are entirely unrelated to others, like your *on-page-visit* hook is useful.
22:29:55
Shinmera
Deeds, an event system I wrote, allows priority between event handlers via a dependency scheme.
22:32:47
_death
jmercouris: plans may be modeled as dags.. usual plan for make is the plan of building a system
22:33:10
jmercouris
I wish I had someone who was a CL professional to just say "here, don't do that, that's a stupid design, do this"
22:33:29
jmercouris
I kind of do, via this channel, but it involves me thinking first of many stupid designs and then asking people their opinions
22:34:18
_death
jmercouris: making stupid designs is one path to forming opinions about what's stupid ;)
22:35:19
jmercouris
perhaps thats because I set out to make emacs as browser, maybe I should have just set out to make emacs like UI as a browser
22:38:04
jmercouris
Shinmera: The only way to motivate people and to make sure they have time is if they have money mostly
22:38:20
jmercouris
or if you are just somehow a super passionate leader that can convince people of something, or you can trade social capital or some other such asset
22:38:38
jmercouris
like if I was the leader of the WWF or something, I'm sure people would be more open to working on some project
22:39:08
jmercouris
actually, even if you are employeeing people via cash, you still have to make them passionate about a project
22:39:54
_death
Shinmera: as clothing helps in covering a wart, so do programming languages help in covering deficiencies in programs, the process of writing them, and the persons involved.. Lisp is more like water (maybe murky water ;), intimate and personal, leaving the programmer naked with quirks, creativity, deficiencies, ups and downs, for all the world to see
22:48:15
jmercouris
yes, I could have chained them in one long function, but package maintainers from different packages will not expect that
22:48:51
jmercouris
I see no other magical mechanism, unless they are to override every single function in some sort of chain
22:50:57
stacksmith
If there is a class you expose, say 'browser', an advanced user can subclass it and make modifications - minor or major.
22:52:07
jmercouris
you may be right, I might strip the hook functionality out later in favor of your design
22:52:47
jmercouris
that's not the point, I just want them to be able to hook into any point in my program
22:52:49
stacksmith
Including writing complicated systems to make sure that the limited functionality does not interfere with other parts of itself.
22:53:04
_death
hooks tends to be just a simple mechanism where the hook functions are usually independent of each other.. for more elaborate mechanisms there's advice (say in emacs, where they have depth) or indeed generic functions, or event systems like Shinmera's
22:53:57
stacksmith
By jail I mean limit to something reasonable perhaps. Providing a set of hooks is a way of limiting the user to those hooks instead of rewriting...
22:54:48
stacksmith
jmercouris: I've been doing a lot of rewrites! not worthy of pull-requests if that
22:55:41
jmercouris
I'm just saying, you have some opinions, if you think you can do it better, I would be glad to accept your code
22:56:05
jmercouris
I'm not a good developer, at least not in Lisp, I know that, so I'm always interested in other takes
22:57:17
jmercouris
It was just a friendly suggestion, if you are interested, I am open to PRs, and always looking for contributors, that is all
22:58:08
stacksmith
I've been breaking my brain with my own code... I'll take a look when I get a chance.
22:58:46
jmercouris
Don't worry about it, if you like it you find the time, if you don't, I won't be offended, I understand that our own projects are always most interesting
22:59:43
jmercouris
I found a porter-stemming implementaiton already, but now I'm looking for lemmatization to do a more sohpisticated semantic matching
23:00:52
jmercouris
I see this: https://github.com/eslick/cl-langutils looks pretty abandoned though
23:04:39
shrdlu68
i.e (loop with n fixnum = 0...) works but (loop with n (unsigned-byte 64) = 0...) doesn't work.
23:25:54
phoe
...geez, I types "actually useful" and immediately though of #'ARRAY-ACTUAL-USEFULNESS
23:51:59
stacksmith
Hey, is anyone using defconstant? I keep trying every so often but it always ends with tears.
23:54:19
_death
alexandria has define-constant which may work better for your needs, as it takes a :test argument
23:54:27
stacksmith
I invariably get into a shit-state with slime with restarts and babble about redefining...
23:55:40
stacksmith
I suppose nothing to do with emacs, just a million restarts screwing up my windows and making me feel less hopeful about life.
23:58:45
_death
stacksmith: yes, it allows you to define what "same" means.. in CL parlance, and defconstant, "same" is EQL
0:15:25
stacksmith
_death: premature optimization aside, constants lead to much tighter code with sbcl...
0:28:18
Bike
but it (probably) lets the compiler use a known location, so it should be about as fast as a constant for things that can't be inlined into the actual code, like compound structures
0:37:04
pillton
I'm struggling to understand this optimization. Can you give an example where that optimization is useful? Why is it different then (let ((x *var*)) ...)?
0:46:15
pierpa
a local lexical variable is just a memory location at a fixed address. A special requires access to a symbol value slot, i.e. one indirection, one more memory access.
0:49:31
stacksmith
pillton: sbcl encodes constants as immediates. And more complicated forms, like ash or ldb benefit as well.
0:55:28
Bike
it boils down to setting the symbol-value and setting the info db entry for the variable to :constant
1:09:08
porky11
I'm working on a language in lisp, which is possible to use without brackets and is intended to be used as programming lanugage or language for speaking/writing
1:10:48
porky11
the parser of the fundamental grammar into sexpressions and functions/macros to simplify the declaration of how to expand everything, already is defined https://gitlab.com/porky11/setlang
1:11:41
porky11
the language was intendet to be based on set theory, but I'm not sure, if that's a good approach even for programming language
1:16:41
porky11
there are words, that represend functions, which implicitely open parentheses, and words, that represent objects/sets, which implicitely close parentheses,
1:18:10
porky11
here some small example for lisp https://gist.github.com/porky11/2bb359f62d96822e8c25b1a3b2fc14f2
1:19:26
porky11
that's just a working example, documentation is somewhere different, but most of it are just unfinished drafts
1:20:49
porky11
for examle to sum multiple objects, you would write, when having the identity function `id` `sum id 1 id 2 3
1:21:32
White_Flame
would that be (+ 1 2 3), or (+ 1 (+ 2 3)) or what? impossible to know just from the output example
1:24:17
porky11
for math this concept is not perfect, but for natural language things, this seems useful in many cases
1:26:05
White_Flame
I do like end delimiters, because there's only 1 to deal with, instead of per-element delimiters, like commas in most other languages' lists
1:30:46
stacksmith
Forth is pretty usable, although it becomes convoluted. by optimizing away braces, you lose clarity.
1:30:48
White_Flame
yes, (1 2 3 4 5) vs "1, 2, 3, 4, 5" or "1 and 2 and 3 and 4 and 5" where the latter 2 delimit the list on every element
1:32:52
White_Flame
my example was giving a function name, and then saying that we're going to be using it with a list of parameters
1:35:44
White_Flame
right, does "function with blah blah blah done" sound more natural to you than "function start blah blah blah end"
1:37:06
White_Flame
but in any case, all programming languages are about tracking very specific operations & data paths. Natural language is all about communicating within assumption & implied context, so they're never going to mesh well
1:38:28
porky11
would also be nice, if it's just usable as a language for a game, where you can tell computer players what to do
1:39:59
White_Flame
I think there's many lessons to be learned from SQL and COBOL, both of which were intended to be "like natural english"
1:40:22
White_Flame
and both of which ended up still being specific, fiddly, engineering tasks to write, just like any programming language
1:41:07
Zhivago
I'm not sure about never -- natural language presumes a dialogue between intelligent agents.
1:41:09
porky11
they are pretty stupid languages, expecially SQL just seems like a complicated version of the underlying logic
1:41:38
Zhivago
As we move toward negotiating with intelligent agents rather than specifying dumb machines, natural language will probably come to dominate programming.
1:41:58
White_Flame
Zhivago: right, if we get machine agents to understand English, then we won't have a mesh of programming language & natural language. We'll just have natural language :)
2:01:48
rme
Summary results from my Clozure CL platform survey: https://lists.clozure.com/pipermail/openmcl-devel/2018-February/011797.html
2:06:25
welle
Hi, newbie to Lisp here. There are some instructions for running nEXT Browser in Linux, and they work when I run them one after another in a SBCL repl. When I put them in a progn statement and try to compile them to a binary with save-lisp-and-die, it returns a thread error. Help?
2:09:00
Bike
you shouldn't save-lisp-and-die from slime, it doesn't work well if multiple threads are running
2:14:00
Bike
that's not the usual mode of interacting with lisp. does nEXT not have build instructions?
2:15:48
welle
No, it currently has to be built from source on Linux. I want to use it for browsing so I learn Emacs-style keybinds.
2:17:07
White_Flame
save-lisp-and-die should be given the instructions to start up the system post-restore
2:17:25
White_Flame
you shouldn't try to save a running system wiht threads, open files/sockets/etc, because that's not meaningful to capture
2:17:48
Bike
i think the usual practice with save lisp and die is to write a script system that gets the system into the state you want it to start up in.
2:18:37
Bike
http://sbcl.org/manual/index.html#Function-sb_002dext_003asave_002dlisp_002dand_002ddie here's the docs. i think basically you want to specify the filename, :executable t, and :toplevel set to whatever function should run when the browser starts.
2:22:55
welle
I wrote (sb-ext:save-lisp-and-die "nEXT-Browser" :toplevel #'(progn(require :asdf)(asdf:load-asd "/home/welle/next/next/next.asd")(ql:quickload :next/gtk)(next:start)) :executable t)
2:24:24
Bike
write a file like this: (require :asdf) (asdf:load-asd "~/next/next.asd") (ql:quickload :next/gtk) (sb-ext:save-lisp-and-die "nEXT-Browser" :executable t :toplevel #'next:start)
2:24:30
welle
Do I need to do (defun start-browser () (progn(require :asdf)(asdf:load-asd "/home/welle/next/next/next.asd")(ql:quickload :next/gtk))) ?
2:30:02
welle
Bike: It appears to have created a file, but it flashes a screen and dies when I double-click on it.
2:31:25
Bike
it's possible next:start is written to just start the system, but expects the system to remain up afterward. i wouldn't know.
5:33:26
krwq
How do you create an int and get pointer to it with cffi? I've tried this: (cffi:with-foreign-object (user-data :int) (setf user-data 123) (cffi:mem-aptr user-data :int 0)) but it gives me a value and not a pointer to that value
5:46:45
krwq
thanks pillton - so what does mem-aptr do then and why didn't it complain about type when setfing?
5:47:50
pillton
The value bound to user-data is a system area pointer i.e. it is an object representing an address in memory.
5:51:43
pillton
(cffi:mem-aptr user-data :int 1) <=> (cffi:inc-pointer user-data (* 1 (cffi:foreign-type-size :int)))
5:52:36
aeth
Could someone make a C->CL compiler in CL using CFFI? Or does CFFI not let you do everything that C can do?
5:55:29
aeth
Would it be more efficient than other C->CL approaches? Afaik, Mezzano (or was it another LispOS?) uses a C->CL compiler for Doom.
5:56:53
aeth
Ah, the Mezzano Doom port used an LLVM IR to CL compiler. https://news.ycombinator.com/item?id=14120802
5:58:37
aeth
k-hos: Programming as art is all about using things in cool ways they're not supposed to be used (as long as such ways are legal and ethical)
6:02:11
aeth
iqubic: Imo it's worthwhile to know enough assembly that you can read the output of #'disassemble
6:03:45
aeth
disassemble is implementation-specific (and can also be architecture specific, obviously)