freenode/#lisp - IRC Chatlog
Search
12:24:00
beach
jackdaniel: I will definitely watch it at some point. I have read a few books by Douglas Hofstadter and I like his writing very much.
12:36:32
beach
Different question, but related to my previous one: Suppose I want to implement the SICL garbage collector in Common Lisp. Such a thing must obviously be able to handle arbitrary addresses and arbitrary machine data, let's say in the form of unsigned 64-bit integers. I can see two ways to do it.
12:36:40
beach
Way number 1 is to pretend that memory is a Common Lisp array with element type (unsigned-byte 64). Way number 2 is to provide two functions for accessing memory like MEMORY and (SETF MEMORY).
12:36:46
beach
Way number 1 has the inconvenience that any element of the array that represents an address would have to be shifted right by 8 positions before it can be used as an index. But then, the compiler would generate code to shift it left again to get an address. I would then have to make sure that the compiler is able to cancel the two.
12:36:53
beach
For way number 2, the two functions must be declared to use arguments and values of type (unsigned-byte 64), they would have to be written in machine code (easy), but they still would need to be inlined, so that the compiler does not have to emit code to tag and untag them or (worse) convert them to bignums and back.
12:40:25
heisig
beach: I have a better feeling about way number 2. The raw memory is semantically a different thing than a Lisp vector, and blurring this distinction might lead to confusion.
12:41:42
beach
heisig: I see, yes. The other thing with 2 is that one could add functions for accessing individual bytes if required.
12:45:49
flip214
and I guess that at some point you might need byte-addressing too - which would go against point 1
12:45:58
beach
Other than the potential problems I listed, can anyone think of other ways in which I could get into trouble, i.e., what would I have to make sure I can convince the compiler to do?
12:47:13
flip214
so a 64-bit-word "memory layout" means that even addresses as tagged integers go into a single register... that sounds like #1 would be much easier.
12:47:58
flip214
and for byte-addressing needs you might have a second "special" array -- which would be used very infrequently, so a few bignum operations won't matter.
12:48:26
flip214
(which are very unlikely, as the top half of 64bit memory is reserved for the kernel anyway (typically), so userspace wouldn't have such adresses)
12:48:59
flip214
the two functions sound much more better from an abstraction level... but does that really matter for such a low-level use?
12:50:05
flip214
will that have to deal with addresses of #x8000...000 and higher, or only smaller ones?
12:50:47
flip214
well, (AREF *MAIN-MEMORY* address) vs. (MEMORY address) sounds like a trivial difference
12:51:14
flip214
so I'd say go with the second, and if you find out you want the first make (DEFMACRO MEMORY (a) `(AREF *MAIN-MEMORY ,a))
12:55:54
froggey
I use option 2 in mezzano, with accessors for different element types. memref-t, memref-(un)signed-byte-{8,16,32,64}
13:01:21
flip214
beach: > Sometimes a majority simply means that all the fools are on the same side.
13:01:52
flip214
https://www.just-one-liners.com/whenever-you-find-yourself-on-the-side-of-the-majority-it-is-time-to-pause-and-reflect/
13:05:19
jackdaniel
it might be, that finding yourself on the side of minority is also a good time to pause and reflect
13:06:54
jackdaniel
I mean – strong convictions are suspicious whenever found in a majority crowd or in a minority group
13:09:05
beach
http://www.prosebeforehos.com/quote-of-the-day/12/28/bertrand-russell-quote-fools-fanatics-wise-men/
13:13:42
beach
flip214: Anyway, the more I think about tagged rack pointers, the more goodness I see.
14:12:07
Xach
shka: ql-progress! but it is not really a library, but part of quicklisp. you could rip it out though.
14:23:46
beach
flip214: I changed the SICL specification so that racks are tagged, using a single commit so that it can be easily undone if necessary. Let me know if you see any problems with it.
14:25:08
Xach
shka: thanks. i wrote a HTTP client that predated curl and wget, and put up a semi-joking comparison table when the others came around, and one of my plus features was "cool progress bar". but then curl and wget got really cool progress bars, too.
16:35:49
jmercouris
what I'm doing now is typing in "sbcl" and then within the repl typing the command to compile
16:37:20
jmercouris
well, I guess it works the way someone would imagine, I should have tried it before posting here
17:06:07
kenster
Hey, for anyone interested, I am streaming some Common Lisp/C++17 programming: https://youtu.be/-JWVx-W0rmA or https://www.twitch.tv/kingherring
17:39:51
kenster
does anyone know how I can associate the class with the struct value in that hash table
17:45:15
pjb
But the point is probably that "I want to pass in the upload-session class symbol and get 'upload-session" is not what you want.
17:47:46
pjb
Now, you need the *c-class-structs* table set up at macroexpansion time, in the compilation environment. The simpliest to fill it is to define a macro that expands to an eval-when setf gethash.
17:52:51
pjb
yeah, C compiler don't provide controled environments, which means that you must absolutely not have any crash. (sigsegv, or other).
18:01:05
pjb
A friend of mine is working on something similar: http://peerstorage.org https://www.linkedin.com/company/peerstorage/
18:04:14
Demosthenex
anyone seen a lib that helps make TUI apps for cl? yes, ncurses exists, but the forms portion never seems to be included in the libs. widgets/forms aren't the same as screenhandling.
18:10:46
Demosthenex
kenster: that's basically ncurses simple functions (ie: screen control). i'd really like to find Turbovision :P
18:12:38
ebrasca
kenster: I have make suport for fat32 ( Need optimization ). Now starting ext2/3/4 suport.
19:51:26
fortitude
do any lisps provide a way to have global variable that /aren't/ dumped as part of an image?
20:36:51
charh
Hello! lispers, I have a beginner question. I am a systems administrator (Unix) and a beginner and autodidact.
20:37:01
charh
I write code in shell mainly. All my developments are related to operating systems. it's okay. but ... I want to be a true developer ... and I love Common Lisp as a language.
20:37:14
charh
I am reading practical common lisp, but finally I do not "click" with the development outside of an operating system
20:37:28
charh
My friends, my boss and any other people tell me "Do not learn lisp... is old and deprecated..., learn Java, Python, C, C ++, Rust ..." but I want Common Lisp, for me lisp is magic... I have a small code (in my git) and i love.
20:38:02
charh
yes, the question is more a suggestion from your experience, but i don't know any friend for talk o read about that.
20:39:01
trittweiler
I think you need to familarize yourself with a Common Lisp development environment. For example Emacs, and Slime (the Common Lisp editing mode)
20:40:21
trittweiler
The application design of Emacs can be quite illuminating by itself. (There definitely are other development environments, though, in case Emacs is just not your cup of tea)
20:41:18
charh
thanks trittweiler :), i have installed and configured (emacs + slime), I go to learnd (and read) more about that
20:41:26
Demosthenex
charh: i'm a systems guy too. CL is great for all kinds of backend tasks. python and java etc are for frontend stuff
20:43:34
Demosthenex
there's an analogy between learning lisp and latin. learning latin made you understand more about many different languages, it gave you depth, insight. lisp is the same
20:43:38
trittweiler
SICP (Structure and Interpretation of Computer Programs) is a very good book on learning the foundations of programming. It uses Scheme, a cousin of Common Lisp.
20:44:01
Demosthenex
with the exception where latin died off in usage, lisp is still used. all other languages are graduallying adding features lisp had many decades ago
20:44:26
trittweiler
there are also video lectures available from the 80s, which I found very enjoyable.
20:46:00
Demosthenex
i'm chafing over the gui and web frontends to everything. i'm tinkering with some personal apps that are often simple CRUD interfaces to a sql database. i don't want a gui, i want a curses based forms frontend
20:48:49
charh
oh ok, Demosthenex, fine! and thanks again :), any library for read and alternate between code and books?
20:49:17
trittweiler
If it's a good use of your time to learn Common Lisp is arguable. People in this channel would of course say yes. :) Python and Go would probably be more easily marketable skills (I think those are quite common in the devops world.) If your aim is to learn programming as a craft, Lisp will be a very good foundation like Demosthenex said
20:51:01
Demosthenex
ESR and other great programmers talk about a moment of enlightenment, where it just goes *SNAP* in your head and you gain insight. i was skeptical, but it's true
20:51:25
Demosthenex
absolutely changes your perspective when dealing with programming problems and other languages.
20:52:00
Demosthenex
i did a self study through "Practical Common Lisp" several years ago, it was time well spent.
21:00:19
Demosthenex
charh: use emacs. it'll open your eyes. plus it runs on lisp, so you can tinker anytime without needing a dev environment for little hings
21:03:58
charh
thanks Demosthenex :), I will search very information about emacs, your suggetions is goooood/great for me
21:05:58
Demosthenex
i have found Structured Terminal Forms Library (STFL), s-lang, ncurses forms, and others... but few bindings for cl.
21:26:03
whartung
emacs is all fine and good, but it doesn’t need to be the first step. You certainly don’t need Slime or anything fancy out of the box either. What you need, at a minumum is an editor that helps you with parentheses matching. Emacs will do that, but so will vi. emacs is nice because it’s got “lisp aware” indenting, which helps.
21:27:18
whartung
learning in a vacuum is all well and good, but it’s better if you’re trying to solve some problem. Computers without problems to solve are also known as “room heaters”
21:29:37
pjb
Yes, emacs is not necessarily the first step. But once you start using it, you'll always regret not having used it sooner.
21:30:20
pjb
I started using emacs in 1992, and I would have hit myself for not having started using it much earlier.
21:32:58
charh
whartung: my first step is a mix unix/CL and resolve problems outside shell scripting, I will rewrite my shell scripts in CL or the functionality
21:34:56
whartung
ok. That’s good. You might consider scsh — it’s a “Scheme Shell”, so, it’s a Scheme, not a Common Lisp, but it is designed to be a shell and has artifacts in place to handle things like sub processes and pipes and such.
21:35:37
whartung
that’s always been the problem I could never surmount in my “Lisp as shell” dabbling — finding a suitable usable pipe replacement, as it’s so engrained in the shell experience.
21:37:10
whartung
I edit with emacs, but that’s it. I leverage it’s autoformatting the most. I run Lisp in a separate window, and just continually reload my work. (defun l () (load “file.lisp”), and then just type (l) over and over (typiecally with REPL history ala readline)
21:38:15
whartung
I only say this as it’s one thing to want to learn from forms and the language, another to have to tool up an entire environemtn just to learn those forms and language — it’s not the same
21:38:49
charh
thanks whartung i was don't sure about scsh, but i will prove it! and read mooooore about emacs and CL :D
23:45:20
ebrasca
kenster: In serial experiments lain there where this virtual space with representations.