FreeBirdLjj has quit [Remote host closed the connection]
furiousDingo22 has joined #ocaml
furiousDingo22 has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
wize has quit [Ping timeout: 256 seconds]
Whooa2112 has joined #ocaml
Whooa2112 has quit [Remote host closed the connection]
kakadu has quit [Remote host closed the connection]
cryptocat1094 has joined #ocaml
ChristopheT has joined #ocaml
talisein23 has joined #ocaml
grossing11 has joined #ocaml
grossing11 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
ChristopheT has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
talisein23 has quit [Remote host closed the connection]
ygrek has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
zolk3ri has joined #ocaml
RustyJ0 has joined #ocaml
RustyJ0 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
neatonk has quit [Ping timeout: 256 seconds]
zolk3ri has quit [Quit: leaving]
zolk3ri has joined #ocaml
shinnya has joined #ocaml
host has joined #ocaml
host has quit [Killed (Unit193 (Spam is not permitted on freenode.))]
pierpal has joined #ocaml
<loli>
ollehar in CL "(= (+ 0.2 0.1) 0.3)" is True
<companion_cube>
it doesn't respect the float standard? ;s
<loli>
CL is a bit weird
<loli>
it seems to be implementation detail
<loli>
" There are four kinds of floats in Common Lisp, which provide increasing precision (implementation-dependent). By default, implementations assume short floats, which have limited precision. To input a more precise float, other textual notations must be used, e.g., "1.0d0" for a double-float."
jack5638 has quit [Ping timeout: 240 seconds]
<Drup>
I'm questioning the sanity of whoever wrote that specification
<loli>
CL was designed by committee, to appease most of the major lisp companies, guy steele had a hand in helping it
<loli>
many people came out thinking CL wasn't a real lisp
<ZirconiumX>
I thought it would do rational arithmetic
<loli>
you can make it do rational arithmetic, but I"ve poisoned the numbers with a .
Jesin has quit [Remote host closed the connection]
jack5638 has joined #ocaml
CC665 has joined #ocaml
kakadu has joined #ocaml
manas has quit [Read error: Connection reset by peer]
manas has joined #ocaml
CC665 has quit [Ping timeout: 256 seconds]
manas has quit [Remote host closed the connection]
manas has joined #ocaml
neatonk has joined #ocaml
cryptocat1094 has quit [Quit: later]
FreeBirdLjj has quit [Remote host closed the connection]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
Guest85232 has quit []
Haudegen has joined #ocaml
gre has joined #ocaml
<discord>
<Perry> loli is not accurately reflecting Common Lisp. The CL floating point stuff (and numeric tower in general) is very well thought out.
<discord>
<Perry> Those sections of "Common Lisp: The Language" are great reading.
gre has left #ocaml [#ocaml]
shinnya has quit [Ping timeout: 240 seconds]
<loli>
I should read those sections, the v2 version is always fun to jump around and learn more about
<Fare>
you can also (let ((*read-default-float-format* 'double-float)) (read-from-string "1.0"))
<Fare>
dynamic scoping FTW!
<Fare>
I really miss it in OCaml.
<companion_cube>
OCaml is closer to lambda calculus, it seems :]
<discord>
<Perry> Dynamic scoping of that sort makes the type system a horrible piggy mess.
<discord>
<Perry> Suddenly you've lost referential transparency left and right.
<loli>
After toying with OCaml for a few weeks, it reminds me a lot of my CL code but nicer in a few ways
<companion_cube>
is it even typeable?
<loli>
dynamic variables are annoying with laziness as well
<Fare>
OCaml is closer to making everything ugly by forcing you to use monads instead of suitable effects.
<discord>
<Perry> companion_cube: with sufficient pain anything is typeable, right?
<companion_cube>
no one forces you to use monads…
<companion_cube>
(\x. x x)(\x. x x) is hard to type :D
<Fare>
next, everyone will be writing code in John Tromp's Binary Lambda Calculus.
<discord>
<Perry> Fare: there's mutability, and soon even an effect system.
<discord>
<Perry> companion_cube: "adds confusion when appended to its quotation" adds confusion when appended to its quotation.
<Fare>
On the one hand, I really miss macros, dynamic scoping, dynamic typing, etc.
<Fare>
On the other hand, the type system makes large-scale refactoring tractable.
<discord>
<Perry> There is syntactic extension in OCaml, it's just less convenient.
<discord>
<Perry> dynamic scoping is, I think, an antipattern.
<companion_cube>
the absence of dynamic scoping probably also helps a lot with refactoring
<discord>
<Perry> That said, I do prefer lisp's "feel"
<discord>
<Perry> companion_cube: dynamic scope is a nightmare for everything, including refactoring.
<Fare>
dynamic scoping is an antipattern when used for the things it's not meant for, and a pattern when used for the things it's meant for.
<discord>
<Perry> companion_cube: it existed at first because people didn't know how to efficiently implement lexical scope. then later, it was kept around because people were used to doing certain horrible tricks.
<discord>
<Perry> I think the only proper use of dynamic scope is catching exceptions. I can't really think of others that I care to touch.
<companion_cube>
well it only exists in lisp, nowadays, doesn't it?
<Fare>
Give me Lisp special variables over any of the nonsense you have in other languages for context variable, thread variables, dependency injection, etc.
<companion_cube>
in particular elisp and CL, but not scheme, right?
<discord>
<Perry> companion_cube: only in common lisp and elisp.
<discord>
<Perry> companion_cube: scheme etc. have no dynamic scope.
<companion_cube>
yeah that's what I thought
<companion_cube>
oh and bash
<Fare>
All good schemes have "parameters" which provide dynamic scoping, though with clumsy syntax.
<companion_cube>
is it in the standard?¡
<Fare>
and CL uses lexical scoping by default, as it should.
<discord>
<Perry> the thing in scheme that lets you emulate the same stuff is call/cc but it turns out you don't even want call/cc...
<Fare>
companion_cube, which "standard"?
<companion_cube>
hmmm scheme has a standard, right? R*S* for some values of *
<discord>
<Perry> CL's standard allows the use of dynamic variables.
<discord>
<Perry> Scheme's does not have such a thing.
<companion_cube>
right
<discord>
<Perry> I don't know what Fare means by "parameters"
<Fare>
Racket, Gambit, Chez, have parameters.
<discord>
<Perry> Fare: you know how long I've been using lisp. I miss a lot of it, and really wish for a combination of ocaml's type system and scheme's syntax, but mostly I think dynamic scope is a lose.
<discord>
<Perry> What are parameters? Perhaps I've never read that part of the Racket manual.
<Fare>
I believe Chez introduced them first. Oleg (I think) has a paper on how to do them properly with delimited continuations.
<discord>
<Perry> Delimited continuations seem to generally be a win over the full call/cc.
<Fare>
They are, hands down.
<Fare>
I'm sad that Gambit doesn't seem to do them 100% properly.
<Fare>
(but maybe I underestimate Gambit)
<discord>
<Perry> This documentation seems to mostly be using this for thread local storage and for exceptions.
<discord>
<Perry> the chez compiler is now open source? or is it the gambit one? I can't remember.
<discord>
<Perry> which one did cisco buy by accident?
<Fare>
I use them for all kinds of things. Database context. HTML vs TeX output context. Graphic context. Logging context. Whatever "dependency" other idiots have to "inject" like heroin.
<Fare>
Cisco bought and eventually opensourced Chez.
<loli>
racket has dynamic scoping via parameters
<loli>
oh Fare you've already linked it, my bad
<companion_cube>
sounds like passing a lot of parameters implicitly :s
<discord>
<Perry> companion_cube: sort of. Exceptions are a case of dynamic scope, even in OCaml. when you throw, things are caught dynamically and not lexically.
alphaseg14 has joined #ocaml
<Fare>
I implemented dynamic scoping for Java. Needless to say, my colleagues didn't want to touch it, even though it would have saved their asses. No, much better to add ten extra parameters to each and every single function... and then cry when you have to wrap around each and every function in every library you use that fails to pass them around.
<companion_cube>
Perry: although it only goes down, not up
<discord>
<Perry> and thread local storage is always sorta kinda dynamic scope for obvious reasons.
<Fare>
Or then again, you could use a State Monad Transformer.
<discord>
<Perry> indeed, it only goes down, not up.
<companion_cube>
or just pass a context record by hand, which is what I tend to do
<discord>
<Perry> That's why it doesn't suck.
<Fare>
One State Monad Transformer for each and every dynamically scoped variable.
<companion_cube>
lol
alphaseg14 has quit [Killed (Unit193 (Spam is not permitted on freenode.))]
<discord>
<Perry> Fare: why not just use a mutable record?
<discord>
<Perry> and pass it?
<discord>
<Perry> That's just fine.
<discord>
<Perry> That's why OCaml is not Haskell, purity is sometimes a pain in the neck.
<companion_cube>
because then you wouldn't have to stack 20 layers of monads
<discord>
<Perry> Ah, yes.
<Fare>
is your mutable record automatically restored at the end of every scope, while being properly private to each thread?
<loli>
in Haskell, one would just use 1 monad transfer at least MTL style (idk about effects style however)
<loli>
1 state monad*
<discord>
<Perry> Fare: it can easily be.
<companion_cube>
well it's quite rare that I need to modify something only locally
<companion_cube>
but when I do, I use something like `with_foo` or `finally` or whatever
<companion_cube>
(or you can make the record immutable, of course)
<Fare>
Yes, you could use a single monad transformer plus some multiplexing mechanism for your dynamic variables to share the same monad. Good luck with that in a statically typed way, though (in Java, I cheated with some dynamic casts)
<companion_cube>
I definitely don't want this state to carry arbitrary stuff *anyway*
<companion_cube>
I want to know what's in it …
<Fare>
(Java is an untyped language anyway: all the disagreements of typing with none of the warranties)
<Fare>
companion_cube, one man's state is another man's implicit infrastructure.
Trashlord6 has joined #ocaml
<Fare>
"Oh, I need to monadicize all my code to add function tracing? oops."
Trashlord6 has quit [Killed (Unit193 (Spam is not permitted on freenode.))]
<companion_cube>
or, just add one field to the state parameter?
<loli>
well if you'are already in the state monad, your code would already be monadic
<loli>
just add it to type signature
<Fare>
good luck allowing decentralized, incremental, extension to "the" state parameter, in a well-typed way.
<companion_cube>
assuming I would want to do that, yeah
<Fare>
Idiots who preach pure functional programming for toys that fit in 100 lines, with techniques that definitely won't scale to a million line program.
<companion_cube>
Fare: please don't insult people
<Fare>
Not insulting anyone in particular.
<companion_cube>
besides, we're on #ocaml, no one preaches "pure functional programming" here
<Fare>
But yes, there are plenty such idiots.
<companion_cube>
(otoh I often wonder what justifies having 1M lines of code in one single program… wow)
<Fare>
Overall, it's still a refresher compared to the idiots from 20 years ago who preached "Object-Oriented Programming" full of murky mutually contradictory non-concepts.
<Fare>
companion_cube, ever written an airline reservation system?
<discord>
<Perry> Hey, OO programming in Smalltalk was great fun. It's just grotesque in things like C++.
<Fare>
I made up the term 'object-oriented', and I can tell you I didn't have C++ in mind. — Alan Kay, OOPSLA '97
<discord>
<Perry> And Common Lisp, your favorite language Faré, has objects. You object to them?
<companion_cube>
nope, and I don't intend to
<companion_cube>
but surely you don't write 1M lines in one project? you could split stuff into libraries?
<discord>
<Perry> Alan Kay's opinion on C++ is beautifully correct. 😃
<discord>
<Perry> Faré wrote a big airline data system in Common Lisp. With others.
<Fare>
Perry, I didn't like the fact that they were used in a mutable way, so I wrote my own immutable object library. It was VERY nice. Read the paper: https://github.com/fare/lil-ilc2012 "LIL: CLOS reaches higher-order, sheds identity, and has a transformative experience"
<Drup>
to be fair, OO was not a very good name for what alan kay had in mind. It was a very good marketing name, though
<Fare>
Actually, using a little bit of linear typing, you find that stateful vs pure, OO vs typeclass are two independent axes to view isomorphic data structures.
<companion_cube>
like "dynamic programming" ? :D
<discord>
<Perry> Smalltalk is highly flawed, but you have to understand, 35 years ago it felt like a dream.
<Drup>
companion_cube: that one is really terrible
<companion_cube>
and it was on intent, too
<discord>
<Perry> Smalltalk is also blissfully internally consistent.
<discord>
<Perry> Alan Kay learned a lot from the good parts of lisp as well.
<Fare>
I'm not criticizing the Smalltalk of 40 years ago. It was a great progress over the C++ of 30 years ago.
<discord>
<Perry> It was great progress over modern C++.
<discord>
<Perry> Frankly, removing your own eye with a rusty spoon is preferable to C++.
<companion_cube>
did C++ exist 30 years ago? I thought it started in the 90s :D
<discord>
<Perry> C++ was created in the 1980s.
<companion_cube>
Perry: the sad thing is that unti recently, there was no real contender to C++
<Fare>
"Cfront was the original compiler for C++ from around 1983"
<companion_cube>
oh wow
<companion_cube>
C with classes, heh
<discord>
<Perry> Originally it was called C with Classes. The first edition of The C++ Programming Language was 1986 or so.
<Fare>
Perry, I didn't know you were into demonology and dark arts.
<discord>
<Perry> Then from there it metastasized. I have a shelf of editions of The C++ Programming Language. Each edition is 2x the last.
<discord>
<Perry> Faré: I can call spirits from the vasty deep.
<companion_cube>
"the design and implementation of C++" does cast a bit of light on why the language is so convoluted
<discord>
<Perry> Anyway, my guess is that the doubling of both The C++ Programming Language and the language standard will continue. This means that eventually, it will require all the matter in the solar system to store the PDF.
<discord>
<Perry> C++ was certainly implemented. Whether it was designed is an interesting question.
<companion_cube>
yeah, just wait until they have concepts, ADTs, pattern matching, and a borrow checker :D
<Drup>
Perry: amuzingly, this exponential grow also applies to the ecmascript spec
<Fare>
"design" is a big word, here. Heaping features on top of each other is as much design as making mounds of rocks is architecture.
<companion_cube>
its design isn't that bad given the constraints
<discord>
<Perry> Eczemascript. Shudder.
<companion_cube>
but the constraints are insane
<discord>
<Perry> The term "overconstrained" comes to mind.
<companion_cube>
exactly
<Armael>
Checking things? Is that really in the C++ spirit? :3
<Fare>
C++ will die along with the last C++ programmer. I don't recommend genocide, though, but voluntary extinction. http://www.vhemt.org/
<Drup>
companion_cube: Wasn't there a proposition to have a lifetime system in C++ by Stroustrup ? I remember someone describing it as "Rust without the borrow checker"
mariari has joined #ocaml
<companion_cube>
Drup: that's why I mentioned that
<companion_cube>
also, concepts are being discussed; ADTs might come some day, who knows
<companion_cube>
anyway, I know very good people who are C++ programmers, so it seems you can use that and no become insane
<companion_cube>
but it's certainly not for everyone
<Fare>
(The acquiring company had an experiment to translate part of the million-line airline software system above-mentioned to C++. The code did run 3-20% faster, but was 10x larger and less maintainable. Instead they decided to spend some resources improving the Lisp compiler.)
<companion_cube>
well I hope rust will help fix that
<companion_cube>
it already seems quite promising for web browsers
<discord>
<Perry> I can't remember enough C++ at one time to be productive in it. I'm too old and inflexible. It's maybe okay for young men.
<discord>
<Perry> (and women)
<discord>
<Perry> Rust seems fine as an alternative in this space.
<companion_cube>
rust seems perfect as an alternative in this space
<companion_cube>
(by which I mean I couldn't image anything better)
<Fare>
Anyway, I'm writing monadic code in OCaml, using dirty tricks with global variables some of which only work "thanks" to the fact that there is only one real thread in Lwt, and, oh well, yeech, that part would be much nicer in Lisp.
<discord>
<Perry> why wrote monadic code in ocaml?
<Fare>
(On the other hand, I really enjoy how the typesystem lets me be sloppy and catches me)
<discord>
<Perry> I mean, yes, you can, but ocaml lets you not write monadic code if you don't want to.
<Fare>
Perry: mostly for Lwt, but also for monads that emulate dynamic scoping, stricter exception control, etc.
<Fare>
Also because I want to translate it all to Coq after it's working.
<discord>
<Perry> companion_cube: rust may prove less perfect when we learn more. In thirty years, we've learned a great deal. It's probably close to the best we can do right now....
<companion_cube>
and how do you plan to translate lwt to coq?
<Fare>
I only plan to extract to it.
<companion_cube>
Perry: agreed, but rust eschewed compat with C, and learnt a lot from the last 40 years of research or so
<companion_cube>
Fare: usually people do the opposite, btw, they extract OCaml from coq
<Fare>
I write a demo in OCaml. I want to port it to Coq later.
<Fare>
I write it in a style that I know will be expressible in Coq.
<companion_cube>
ah, that explains a lot
<companion_cube>
(but then you're writing purely functional code, be careful :p)
depleted has joined #ocaml
<Fare>
yeah, well, it's purely functional, until it assumes orthogonal persistence :-/
<companion_cube>
"orthogonal persistence"?
<Fare>
and I don't feel like remonadicizing everything at the time being (or ever, if I can get away with not doing so)
depleted has quit [Killed (Sigyn (Spam is off topic on freenode.))]
<Fare>
Although, considering the discussion of Alan Kay above, chapter 1 will probably speak to you, too.
<Fare>
orthogonal persistence: the silly notion that if you have an interaction with the computer, then turn it off, the next day when you turn it back on the computer will still remember about it, without your having to do anything special about it.
<Fare>
the way I used to enjoy my HP calculators.
<companion_cube>
right
<Fare>
or some enjoyed their IBM mainframes.
<companion_cube>
(hopefully there's a way to clear the cache, but yeah(
<companion_cube>
))
<Fare>
Or Jochen Liedtke implemented on 8-bit east german machines in the late 1970s / early 1980s.
<Fare>
(L3 and L4 came out of it)
<Fare>
Jochen has a great paper on his 17 year experience with orthogonal persistence. Published in 1993.
<companion_cube>
I mean this notion seems nice, but it also sounds a bit too much like magic
<companion_cube>
(it does remind of urbit…)
<Fare>
sorry, it was only the 13 year experience at the time, 17 was bad memory
<Fare>
urbit has it, but also a lot of other baggage.
<Fare>
his first system was shipped in 1979.
<Fare>
he tells stories that the persistence latency was several minutes, so many times, the system was saved from memory-corrupting bugs by shutting it down before the corruption would persist (also losing a few minutes of actual work by other people).
<Fare>
Good luck giving static types to that.
<companion_cube>
who knows?
<Fare>
maybe with a reflective dependent type system...
<companion_cube>
if you're serious about persistence, the whole program is persistent too, so you can refer to its hash
<Fare>
As for orthogonal persistence being "magic", companion_cube, do you flush your L1, L2, L3, swap, manually? No? Then why would you want to flush your persistence buffer manually?
<companion_cube>
then values can be persisted along with hash of program+type identifier
<companion_cube>
because persistence eats more and more storage? whereas L* are just caches?
<companion_cube>
what seems weird is that they don't seem to worry about running out of space
<discord>
<Perry> Ah, Urbit. We covered it in our lab on our seminar day devoted to insane ideas in computer science.
<Fare>
It only eats more storage if you accumulate garbage.
<discord>
<Perry> We also covered TempleOS.
<Fare>
Perry, did you also cover the Mill architecture?
<companion_cube>
well intermediate snapshots are garbage, right?
<Fare>
the Intel iAPX432 ?
<Fare>
companion_cube, then why persist them?
<discord>
<Perry> Faré: the 432 was a crazy crazy machine.
<Fare>
Did you cover the Symbolics Ivory ?
<Fare>
or just the PDP-10 ?
<companion_cube>
I don't know, isn't that your point that everything should be persisted? :/
<Fare>
companion_cube, sure, and if you produce 4K pixels at 50 frames per second, I need to save everything, too.
jnavila has quit [Ping timeout: 240 seconds]
<Fare>
Or the system could be deterministic and only record a log of significant high-level events.
<discord>
<Perry> The Lisp Machine was not crazy but was arrogant. The creators hadn't read the IBM 801 papers.
<companion_cube>
right, so you need to request persistence explicitly
<Fare>
unless you type super fast, the system will be capable of reconstituting everything you did from what you type and store each and every significant interaction.
<companion_cube>
then it's just about making persistence easy
<discord>
<Perry> The 432 was sort of an albatross. Really interesting ideas, not easy to implement or use. Again it forgot the 801 papers.
<Fare>
I suppose Superman or the Flash could run out of memory.
<discord>
<Perry> The IBM 801 papers were so useful and so many people ignored the ideas because they came from IBM. They then built stuff without checking if it was a good idea...
<Fare>
Who needs to "request persistence explicitly"? Not the average user or programmer, anyway, but yes, SOMEONE will have to do the job.
<Fare>
the 801 were the original RISC papers?
<discord>
<Perry> Yes.
manas has quit []
<discord>
<Perry> The important lesson was this: measure.
<companion_cube>
right, so it's like calling git in the background, which is doable
<discord>
<Perry> Well, there were several lessons. Measure, you probably can't implement it faster in microcode, and if the compiler can't use the instruction you don't want it...
spew has quit [Quit: Connection closed for inactivity]
<discord>
<Perry> TempleOS was created by someone who is literally mentally ill...
<Fare>
companion_cube, the important thing is understanding the Model-View-Controler model and not having to persist the View.
<Fare>
also understanding determinism and absence of UBE.
Denommus has quit [Remote host closed the connection]
<discord>
<Perry> "Its development began in 2003, after Davis suffered from a series of manic episodes that left him briefly hospitalized for mental health issues.1 Davis is a former atheist who proclaimed that he had "communications" with God, and that God told him the operating system he built was for God's third temple. According to Davis, TempleOS is of "divine" intellect due to the inspired nature of the code, and that God said
<discord>
to create the operating system with 640x480, 16 colors display and a single audio voice. The operating system was written in a programming language developed by Davis in C and C++, called "HolyC""
<Fare>
Perry, I have no excuse.
<discord>
<Perry> Faré: don't be so modest! I'm sure you have a few!
<Fare>
I'm even more mentally ill? Not mentally ill enough?
<discord>
<Perry> Maybe both! 😉
<discord>
<Perry> Is it true you've moved back to Cambridge btw?
<Fare>
It is true.
<Fare>
Taxachusetts is a tax heaven, compared to Manhattan.
<discord>
<Perry> Indeed. Though just crossing the river is enough to fix that.
<Fare>
Also, the People's Republic of Cambridge feels very Alt-Right compared to NYC's mayoral team.
<discord>
<Perry> They haven't banned the market yet?
<Fare>
fewer Trump towers, too.
<Fare>
They all but banned Airbnb :-/
u1dzer026 has quit [Remote host closed the connection]
spew has joined #ocaml
spew has quit [Ping timeout: 260 seconds]
pierpal has quit [Ping timeout: 265 seconds]
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 272 seconds]
neatonk1 has joined #ocaml
neatonk has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
kakadu_ has quit [Ping timeout: 268 seconds]
TC01 has joined #ocaml
steenuil has quit [Remote host closed the connection]
neatonk1 has quit [Ping timeout: 260 seconds]
TC01 has quit [Client Quit]
TC01 has joined #ocaml
Aleszandro has joined #ocaml
Aleszandro has quit [Killed (Unit193 (Spam is not permitted on freenode.))]