freenode/#lisp - IRC Chatlog
Search
9:58:50
MichaelRaskin
Re: scraping and JS — well, I do have my code for driving a sandboxed Firefox via Marionette online.
9:59:25
MichaelRaskin
(And then again I prefer to use CL-HTML5 + CSS-Selectors and some custom code to export to text in a way I like it…)
10:01:17
MichaelRaskin
Fare can realistically demand an exception re: other libraries, because ASDF needs to do a lot of things, and having a ton of dependencies for ASDF is somewhat inconvenient… But yes, this does undermine credibility of an effort for greater unification.
13:44:39
pjb
the fact is, if you have to go to Mars or farther, what programming language should you bring with you? stackoverflow will be at more than 1/2 hour away for Mars, days, or years away if you go farther!
13:45:44
pjb
Will you bring a language for which armies of programmers are needed to develop libraries or give you help to write each line, or will you bring a language in which YOU CAN write everything yourself.
13:52:20
devon
Aeons ago, a friend parodied Dijkstra "My graduate students vill profe a theorem und I vill publish a paper ... but we've no help for the poor slobs in the trenches who minimize head motion to optimize seek time."
13:56:18
pjb
Well, that's not a good parody, because Dijkstra would have had no problem designing an algorithm proven to be the best to optimize seek times.
18:30:08
akoana
Xach: Thank you very much for your work on quicklisp, I really appreciate it - it's especially helpful for a newbee like me.
18:32:50
Posterdati
cage_: no, I'm looking at it... Cazzilli = slang from the city of Cagliari means "not so useful stuffs"
18:39:17
Posterdati
I think would pass 2 or 3 millenia before english could acquire the richness of italian language! :) lol
18:54:54
drewc
(loop :with time = 0 :until (or (fall-of-p *roman-empire*) (>= time (get-universal-time))) :do (incf time) :finally (return time)) => 3758122365
18:59:13
drewc
There is a cl lib based on it that I use daily, and have started porting to another language :)
19:01:00
drewc
CL-USER> (local-time:universal-to-timestamp 3758122762) => @2019-02-02T10:59:22.000000-08:00
19:03:13
drewc
I have some links to related CL libs on the readme here: https://github.com/drewc/gerbil-local-time
19:06:23
drewc
Time is still a big issue for development. My clients have offices in Vancouver, Calgary, Toronto, Montreal, Halifax, and report to London, England. There are reports that want "days". Ok... days where exactly?
19:07:57
drewc
Postmodern has SIMPLE-DATE: http://marijnhaverbeke.nl/postmodern/ . I use that as well, along with local-time, and some other hacks, to try and give what they need.
20:23:56
verisimilitude
I prefer to separate it between what I call ``historical time'', which is measuring time based on regular occurences such as the rotation of the Earth, including leap seconds and all of that crap, and then have just ``time'' for what should be an objective measurement of seconds.
20:24:48
verisimilitude
Base sixty has some nice factors, though, so if we ever reach Star Trek levels of time management, I'd think just extending sixty seconds, sixty minutes, further would be best.
20:26:27
verisimilitude
If you get 60^3, that's just under three days; 60^4 is 150 days; 60^5 is 9,000 days; it works rather nicely, actually.
20:35:49
verisimilitude
That 60^5 unit splits a human life rather well; you'd only live three or four of them, if that.
20:40:02
verisimilitude
It disgusts me that figuring how many seconds old I am, to any reasonable accuracy, requires searching through historical records to see when the idiots decided to add leap seconds here and there and other nonsense.
20:41:16
verisimilitude
If you wanted to create a program that actually traverses the history of the world, as a knowledge base, you'd need to see when a week was subtracted there, and so on and so forth and it's hideously complicated.
20:48:46
pjb
verisimilitude: not counting the international flights you made, which means your proper time got desynchronized with that of Earth!
20:49:48
verisimilitude
I didn't even think of that, though, although probably because I didn't need to.
20:51:56
verisimilitude
See, hideously complicated. I'm usually against changing things just because programming in relation to them is difficult, but time is a mess every which way.
20:54:38
pjb
(let ((my-birth-date '(00 30 18 15 03 1964))) (- (get-universal-time) (apply (function encode-universal-time) my-birth-date))) #| --> 1732073075 |#
20:59:33
aeth
verisimilitude: Base 12 has most of the advantages. Base 60 is just 12*5 for some compatibility with our base 10 (2 * 5) world. The advantages of divisibility (12 items can be divided evenly many ways, while 10 can only be divided evenly into 2*5 or 5*2) are probably not that good now that we live in a digital world. Base 16 would be the way to go IMO.
21:00:36
jackdaniel
luckily for us software is made for real world issues, not for programmers convenience. I doubt computers would be so popular otherwise
21:00:38
aeth
If we had to have a from-scratch number system it would either be base 12 for better dividing, or base 16 (or base 8) for better digital compatibility, though.
21:03:21
verisimilitude
I took the first three primes, two, three, and five, and multiplied them; then you can easily work in halves or thirds or fifths.
21:03:36
verisimilitude
This is also reasonable for a person to learn, since it's still comparable to a normal alphabet.
21:04:21
aeth
30 = 2 * 3 * 5; 12 = 2 * 2 * 3; 8 = 2 * 2 * 2. If you just care about splitting things up, 8 or 12 are simpler because they're smaller. No one would care about fifths if we didn't have base 10
21:05:05
aeth
12 gives you 4ths which are arguably more important than 5ths. You get halves, thirds, and fourths with 12, you only get halves, thirds, and fifths with 30
21:05:36
aeth
60 gives you the most desirable splitting, but it's too large for humans to normally work with as digits
21:05:46
verisimilitude
Really, I'd say base sixty, but that seems unreasonable for a person to learn and may get cluttered with easily confused symbols.
21:07:33
aeth
Oh, and I said 60 doesn't give you 8 but half a minute is a nice, neat division so you can still divide your hour (or other time unit) up into 8
21:07:42
verisimilitude
A base that's a power of two isn't good for thirds, which I'd think is too much to give up.
21:08:44
aeth
The advantage of using octal or hexadecimal is that all of the counterintuitive properties of floating point go away, and the world is increasingly a binary floating point world, with no sign of mainstream decimal floating point support in sight.
21:08:50
verisimilitude
Ultimately, I think it should become a common skill for people to work in many number bases; people are mostly just accustomed to ten and only sixty for time.
21:09:16
aeth
Using a base 2 number system, floating point is (afaik) basically just scientific notation with truncation or rounding in places.
21:11:06
aeth
If my mind was ever uploaded into a computer, and I'm probably born too early for that, I suspect hexadecimal would be more natural to use, at least if my mind got augmented by the technology instead of merely being replicated.
21:11:14
verisimilitude
Let's segue into a Lisp topic; I'm disappointed with using BIT as a stream element type.
21:11:32
verisimilitude
SBCL just ignores every octet that isn't zero or one, which isn't the behavior I wanted.
21:11:41
aeth
verisimilitude: Technically speaking, we're just debating over which *print-base* and *read-base* to use so it's roughly on topic
21:13:32
verisimilitude
So, instead, I'm forced to use (UNSIGNED-BYTE 8) and manually pick it apart, which isn't fun because I'm implementing a format that isn't octet aligned.
21:14:14
verisimilitude
Then again, I could be lazy and wasteful and manually create the bit stream myself.
21:14:16
aeth
if it's not multiple-of-eight I'd expect pain points somewhere along the way no matter what
21:14:46
aeth
Might even be best just to be wasteful and pad it. If you're doing 12, just put 4 0s at the end.
21:16:39
pillton
versimilitude: According to the Handbook of Floating-Point Arithmetic, the Russian SETUN computer represented numbers in radix 3 which is good for floating point arithmetic.
21:17:51
pjb
Once again, only clisp is conforming here: integer 2 is out of range, cannot be output onto #<CLOSED OUTPUT BUFFERED FILE-STREAM (UNSIGNED-BYTE 1) #P"/tmp/bits">
21:19:19
aeth
verisimilitude: Space vs speed trade-off, it's probably worth it on modern machines to be faster. If you intend to save it to disk or send it over the network, you also can use those bits to ensure that the data is still valid.
21:23:04
pjb
(with-open-file (bits "/tmp/bits" :element-type (quote bit) :direction :output :if-does-not-exist :create :if-exists :supersede) (write-sequence #(1 0 2 0 1 0 1 0) bits))
21:23:48
aeth
Built in github/gitlab/etc. pastebins are underused, but they're probably the most reliable
21:24:01
pjb
(with-open-file (bits "/tmp/bits" :element-type (quote bit) :direction :input) (let ((v (make-array 8 :element-type 'bit))) (read-sequence v bits) v)) #| --> #*10101010 |#
21:25:01
pjb
I don't know at sbcl. I would expect bit by bit. which is what clisp does, apart from a header used to complement the octet file size.
21:26:14
verisimilitude
To repeat, SBCL has a nasty habit of simply ignoring any octects that aren't zero or one, in this case. I'm stuck working around (UNSIGNED-BYTE 8), unfortunately.
21:29:17
pjb
verisimilitude: yes, it's crazy, abcl, ccl ecl and sbcl write one byte per bit! I strongly advise you to use clisp.
21:29:54
verisimilitude
I have CLISP installed, but I'd prefer it work on most anything and (UNSIGNED-BYTE 8) is the LCD for this.
21:30:26
verisimilitude
If there were ever an update to the Common Lisp standard, this is just one of the things I'd like to see, proper bit writing and all of that.
21:31:25
pjb
verisimilitude: note that the difficulty here, is when the file size metadata is not specified in bits, but in bytes (which can be different from octet by the way).
21:32:03
pjb
verisimilitude: clisp has to add a header to store the actuall bit size differential, since it cannot count on being able to save an additional metadata.
21:32:17
aeth
pjb: In practice, a byte is an octet and a word is a nonnegative integer multiple of an octet. These are assumptions that essentially all future hardware will make (but some historical systems might not have made)
21:33:08
pjb
aeth: and also in practice permanent storage is not always done on hard disk using octets.
21:35:50
verisimilitude
Nevermind, I suppose. Anyway, what is that ninth bit usually used for, pjb? I'm not familiar with tape much.
21:36:31
pjb
verisimilitude: yes, probably parity. On the other hand, punched cards had 12-bit bytes.
21:37:01
pjb
verisimilitude: otherwise, you must learn about abstraction. This would restore your aesthetic sensibilities.
21:38:50
pjb
Yes, but you could have subfunctions, to decode the bytes into bits. and instead of collecting a list of them you could store them to a bit-vector.
21:43:21
verisimilitude
The most convenient way is to rewrite it in Common Lisp as much as is possible.
21:44:06
no-defun-allowed
I don't consider eating more memory than Emacs a good sign for a UI toolkit, nor does using JavaScript make it more palatable.