rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tuplanolla has joined #ocaml
<d_bot>
<Et7f3> C also
namkeleser has quit [Quit: Client closed]
Tuplanolla has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 256 seconds]
waleee has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
waleee has joined #ocaml
rgrinberg has joined #ocaml
xiongxin has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
average has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
<d_bot>
<antron> indeed in agreement with @Et7f3, C (and therefore C++, though not sure what the "new" `<random>` does). so this was typical to deal with throughout the 80s, 90s, 2000s, and probably still is for many programmers
<d_bot>
<cemerick> I thankfully haven't done anything in C except hardware-related stuff for a looong time, tho I suspect I didn't need any randomness then, there
<companion_cube>
<random> must be a C++ thing
<companion_cube>
but doesn't libc ship with a basic random() function?
<companion_cube>
like a Mersenne twister or something like that
rgrinberg has joined #ocaml
waleee has quit [Quit: WeeChat 3.3]
<d_bot>
<Ethan__Hunt> Is there anyone who can help me in understanding the Building Interpreter using OCaml?
rgrinberg has quit [Ping timeout: 252 seconds]
mbuf has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
shawnw has joined #ocaml
rgrinberg has joined #ocaml
average has quit [Quit: Connection closed for inactivity]
rgrinberg has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
average has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
spip has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
rwmjones has quit [Ping timeout: 256 seconds]
rwmjones has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
chrisz has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot>
<Et7f3> Just describe what command you did and the errors
<Anarchos>
antron should be. i will look for that, thanks
Anarchos has quit [Quit: Vision[]: i've been blurred!]
xd1le has joined #ocaml
<d_bot>
<zakkor> how come you can curry `+` but not `<>`?
<d_bot>
<zakkor>
<d_bot>
<zakkor> ```ocaml
<d_bot>
<zakkor> # let plus_two = + 2;;
<d_bot>
<zakkor> val plus_two : int = 2
<d_bot>
<zakkor>
<d_bot>
<zakkor> # let not_newline = <> "\n";;
<d_bot>
<zakkor> Error: Syntax error
<d_bot>
<zakkor> ```
<d_bot>
<NULL> You can curry both but you need special syntax
<d_bot>
<zakkor> ohhhh
<d_bot>
<zakkor> I see now, the first one is just `2`, lol!
<d_bot>
<zakkor> ```ocaml
<d_bot>
<zakkor> # let not_newline = (<>) "\n";;
<d_bot>
<zakkor> val not_newline : string -> bool = <fun>
<d_bot>
<zakkor> ```
<d_bot>
<zakkor> dope!
<d_bot>
<NULL> You found how before I could write it. Dang smartphone keyboard, can't type fast
<d_bot>
<NULL> Just note that you need spaces around the operator in the parentheses if there are * on its edges so the parser doesn't take it for a comment
<d_bot>
<zakkor> Righto, thanks. Yeah, ocamlformat places spaces between the parens
<theblatte>
and if you want the unary operator you need to add ~, eg the - in -5 is (~-)
olle_ has joined #ocaml
Techcable has joined #ocaml
waleee has quit [Ping timeout: 256 seconds]
waleee has joined #ocaml
xiongxin has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 256 seconds]
bartholin has joined #ocaml
romildo has joined #ocaml
mro has joined #ocaml
xd1le has quit [Quit: xd1le]
mro has quit [Remote host closed the connection]
chrisz has quit [Quit: leaving]
waleee has quit [Ping timeout: 268 seconds]
zebrag has joined #ocaml
mro has joined #ocaml
Anarchos has joined #ocaml
CalimeroTeknik has joined #ocaml
<CalimeroTeknik>
hello! I remember there is a library of network sockets where a program that could potentially read from a closed socket does not compile. what's its name?
shawnw has quit [Ping timeout: 252 seconds]
olle_ has quit [Ping timeout: 256 seconds]
<Anarchos>
who encounters also this error with haikuporter : 'NoneType' object has no attribute 'replace'
* Anarchos
is sorry, this message was for another channel
* rwmjones
is wondering if the new M.(...) syntax lets you write this any better:
<Anarchos>
CalimeroTeknik seems to be linear logic related topic ?
<CalimeroTeknik>
sorry, I can't tell; I don't really understand the wikipedia page "linear logic"
<CalimeroTeknik>
intimidating words like that are the reason Ocaml hasn't completely taken over the world yet :)
<Anarchos>
CalimeroTeknik linear logic is the same as propositionnal logic, but you take into account the number of times a variables is used in a formula
<Anarchos>
rough speaking
<CalimeroTeknik>
ah, yes, the article does say that you "use up" the truth
<Corbin>
CalimeroTeknik: Lucky 10000: Stoichiometry, the arithmetic used to balance chemical equations, gives a linear logic. Whenever we have resources which are conserved, the logic which describes them is usually linear somehow.
<Corbin>
On top of that, OCaml doesn't actually ship linear types, AFAIK. The reason why OCaml isn't that popular is because only a tiny number of languages can ever be popular at once; it's random and extremely lucky whether a language becomes popular.
mro has quit [Remote host closed the connection]
<d_bot>
<darrenldl> absolutely agree: popularity of lang, or even tooling in general, is very luck based
<d_bot>
<darrenldl> having a huge marketing budget helps in some cases
gravicappa has joined #ocaml
<CalimeroTeknik>
I see two important factors: the first to (happen to) be in use (e.g. JS in web browsers) just takes the cake and keeps it; and when that doesn't apply, that the languages that manage to advertise themselves for a particular practical purpose share it
<CalimeroTeknik>
rational and irrational feelings of "easy" (marketed as "simple") and "convenient" also count, and that was what I was stressing: jargon certainly doesn't seem easy and convenient
<CalimeroTeknik>
that's the rational part that's distinct from sheer luck; I've been driven away from ocaml for years for this sole reason: lack of familiarity with the vocabulary used
<Corbin>
Neither of those would explain why C got popular. Network effects explain it, though; C was the native language of UNIX.
<CalimeroTeknik>
indeed, for UNIX; C doesn't have particularly elaborate concepts besides pointers though, does it?
<Corbin>
const, * in types vs * in expressions, malloc() and free(), extern, division, promotion/widening/narrowing, etc.
bartholin has quit [Ping timeout: 252 seconds]
<haesbaert>
One of the main reasons C got popular is because it was the closest thing to portable asm and writing a compiler for it was considerably easy
<CalimeroTeknik>
indeed, easy over simple
<CalimeroTeknik>
counter-argument 1/2: for those of these C concepts that appear in actual names or keywords in the language (const, extern, etc.), they can be explained tersely in layman terms, which is either impossible or not done for Ocaml
<Corbin>
haesbaert: Do you have evidence for those memes?
Anarchos has quit [Ping timeout: 256 seconds]
<haesbaert>
as if I cared about providing evidence to a random idiot on the internet
<companion_cube>
rwmjones: yeah you can overload + in an extension of Int64
<CalimeroTeknik>
counter-argument 2/2: no terse explanation in layman terms of category theory terms used in actual Ocaml docs and even function names were available when I looked for them
<Corbin>
haesbaert: Hey, you're the one spreading misinformation~ But I just wanted to double-check. I'm open to learning things, but if you aren't, then don't worry about it.
<CalimeroTeknik>
haesbaert, that was just rude, period
<d_bot>
<antron> CalimeroTeknik: do you recall where in the docs the terms were used? sounds like something worth making a PR to fix
<CalimeroTeknik>
oh. I did get that the project was open to suggestions for higher clarity, but I didn't imagine it was this much
<Corbin>
CalimeroTeknik: Careful not to fall for the monad-tutorial effect; it's easy to come into an ecosystem with unfamiliar jargon and have a cycle of "I don't understand" => "the words need to change to be simpler" => "I grok it now and you overcomplicated it" => "I need to write tutorials with new simple words so that everybody will see the glory of this language"
<CalimeroTeknik>
I am indeed of the opinion "I grok it now and you misnamed the things"
<companion_cube>
Space suit burritos
<Corbin>
Which names are frustrating? I could guess "functor" and "module".
<CalimeroTeknik>
yes, exactly, as well as monad, monoid
<CalimeroTeknik>
I was thinking of calling them associables or combinables
bartholin has joined #ocaml
<d_bot>
<NULL> Where did you encounter monoid ?
<companion_cube>
associable, like List.assoc? 🤔
<Corbin>
How do you feel about "triple" for monads? For "monoid", the ship might have sailed; the name comes from Bourbaki in the 1940s and is about as standard as "semigroup".
<d_bot>
<antron> all usages of "monad" in the manual are also on this page
<companion_cube>
(how does "triple" apply anyway?)
<Corbin>
("triple" is one of the old terms for monads, before we understood them well. The name comes from three pieces of data: the carrier type, the unit arrow, and the join arrow.)
<companion_cube>
That's an incredibly bad name :D
<d_bot>
<antron> triple is a bogus term for monads, it's too general. it's like calling groups "pairs"
<CalimeroTeknik>
as a name it is very generic, it just means three things associated
<d_bot>
<antron> "a group is a pair of a set (type) and a binary operation satisfying ..."
<companion_cube>
Groups have like 5 or 6 things in them, but yeah, it's terrible
<d_bot>
<NULL> Did you mean monoid ?
<Corbin>
https://mathoverflow.net/a/338282/172672 suggests that Bourbaki thought "monoid" was a better name than "semigroup". Not sure about the history, but today "monoid" lines up well with "monad" and they can be understood together.
<CalimeroTeknik>
semigroup does sound much better!
<CalimeroTeknik>
at least I get an idea that it has items
rgrinberg has joined #ocaml
<CalimeroTeknik>
"monoid" could mean "singleton" as far as I'm concerned, and I wouldn't notice anything fishy going on
<companion_cube>
Monoid allows you to always combine things into one
<companion_cube>
That's kind of nice :)
<CalimeroTeknik>
I did suggest "combinable" earlier precisely for that reason
<Corbin>
Hm. What would "commutative monoid" become? (Is "commutative" better than "Abelian"?)
<CalimeroTeknik>
the core of the matter is that the name does not make it apparent that it is a set, to begin with
<d_bot>
<NULL> Semigroup now has a definition which is different to monoid
<companion_cube>
commutative is a lot better than Abelian
<CalimeroTeknik>
yes!
<CalimeroTeknik>
NielsEnrikAbel-ian is not very transparent and meaningful
<CalimeroTeknik>
Henrik*
<CalimeroTeknik>
at least it should be not too hard to agree on not naming library functions after their inventor :)
<Corbin>
CalimeroTeknik: Ah! This is an important detail; a monoid has an underlying set, but it is not inherently a set. This is a recurring theme in abstract algebra.
<d_bot>
<NULL> CalimeroTeknik: Would you change "currification" ?
<d_bot>
<antron> to currying?
<CalimeroTeknik>
ideally, though since the concept can be explained in layman terms using only the term "function", that was manageable
<d_bot>
<NULL> Would you say monoid and monad cannot be explaied in layman terms ?
<CalimeroTeknik>
actually I have proof by example that they can be! but I haven't seen that much in the wild
<d_bot>
<NULL> Monoid : set with an operation that is associative (ie you treat arguments as if they were in a list, only their order counts)
<companion_cube>
NULL: that's just the definition…
<Corbin>
The laity doesn't know what a function is. I hear that, among young students, the majority no longer know what a filesystem is. Programming concepts only exist in the laity because we teach it to them.
<d_bot>
<NULL> Then I argue the definition only uses layman terms
Anarchos has joined #ocaml
<companion_cube>
Corbin: young students know nothing, as always, because they need to learn :p
<CalimeroTeknik>
I have an even better one actually: a type, a function of two arguments of the type whose order don't matter and that returns the type, and a value of the type that, when supplied to the function, makes it return the other argument
<CalimeroTeknik>
*this* is what I needed to hear as the definition of a monoid applied to programming; anything more would have been too hard
<companion_cube>
the order does matter though
<companion_cube>
but you also just said the definition, with words instead of 2 short equations
<CalimeroTeknik>
commutative = order doesn't matter
<d_bot>
<NULL> Monoid: associative though
<CalimeroTeknik>
oh wait; associative not commutative?
<companion_cube>
not all monoids are commutative, indeed
<companion_cube>
(e.g. list)
<CalimeroTeknik>
see, it's too hard already, I'm mixing up jargon terms (associative and commutative)
<companion_cube>
it's like confusing size and alignment in C
<companion_cube>
just learn :p
<companion_cube>
(alignment… talk about "simple" concepts)
<d_bot>
<NULL> Basic algebra should be part of the maths basics programmer have to learn
<CalimeroTeknik>
it is, in the head of the assembly zombie
<d_bot>
<Et7f3> I have learn the term but too hard to remember those deconnected like abelian ... wtf just because abel described it
<CalimeroTeknik>
you also assume unlimited attention ability from the layman, which is far from the truth, companion_cube
<companion_cube>
sounds like advocating for C, yes
<companion_cube>
each line can hide a bug 🎉
<d_bot>
<NULL> I think everyone here agrees that Abelian should be replaced by commutative
<d_bot>
<Et7f3> also ring <> group. I think group is smaller ?
<d_bot>
<NULL> Has less operations*
<companion_cube>
ring > group
<d_bot>
<NULL> (1 vs 2)
<companion_cube>
ring is group + monoid (or semi group? I forget) + some distributivity between the two, iirc
<companion_cube>
it's been a while
<d_bot>
<antron> people argue about whether the second operation has to have a unit or not
<d_bot>
<antron> so different universities can favor different definitions of rings
<companion_cube>
heh, fun
<companion_cube>
does "positive" mean > 0 or >= 0 ?
<d_bot>
<antron> probably even varies by office as you go down the math corridors 🙂
<companion_cube>
depends on your country!
<d_bot>
<antron> or natural numbers start with 0 in computer science but sometimes with 1 in "classical" mathematics departments
<d_bot>
<Et7f3> I have saw N* for N\\{0}
<companion_cube>
for a logician it's obviously 0 included :p
<d_bot>
<NULL> Are there people to argue "positive = n >0" is the better choice ?
<companion_cube>
🤷
<d_bot>
<antron> i've seen even J for natural numbers, starting with 1 🙂
<d_bot>
<antron> i was always exposed to postiive is > 0. >= 0 is non-negative
<d_bot>
<NULL> Some countries have N+ for N with 0
<d_bot>
<NULL> But is it a better convention to always name the useful set as "the non-negatives" ?
<companion_cube>
@antron in france it's "positive" and "strictly positive"
<companion_cube>
the british would say "positive, quite"
<d_bot>
<Et7f3> (I don't remeber what is positive in my country) but positive should be > 0 so we are explicit and we say positiv or nul for >=0
<d_bot>
<NULL> In fact, it just replaces >= with >
<d_bot>
<NULL> Why tho ?
<d_bot>
<antron> because is zero both positive and negative, or is it neither?
<d_bot>
<NULL> It is both (in France)
<d_bot>
<Et7f3> this sign is called > describe greater(one word one symbol) and >= describe greater or equal (2words 2 symbols)
<companion_cube>
why not both?
<CalimeroTeknik>
I use the word "count" for numbers ≥0
<companion_cube>
0+ and 0-, just like with floats :)
<d_bot>
<antron> no reason why not. but wherever i was, it was neither 🙂
<CalimeroTeknik>
er, for integers ≥0
<d_bot>
<Et7f3> oops wrong encoding
<d_bot>
<NULL> I argue >= should be greater than, > being strictly gt
<d_bot>
<antron> the IRC bridge is failing with whatever that symbol is suppoesd to be
<d_bot>
<antron> >= is read as "greater than or equal"
<d_bot>
<NULL> (It's also failing with …)
<d_bot>
<Et7f3> we see two time the same sequence
<d_bot>
<antron> and > is "greater than"
<CalimeroTeknik>
me? ASCII version: "I use the word "count" for integers >=0"
<d_bot>
<antron> "greater" is already greatER
<d_bot>
<Et7f3> yes thanx
<companion_cube>
> should be greaterer
<CalimeroTeknik>
-0 and +0 sound like they should be plus or minus epsilon, formally speaking
<companion_cube>
and >=, greaterish
<d_bot>
<NULL> I know, but that's also a bad convention. Having comparisons be strict by default is strictly less good
<d_bot>
<antron> companion_cube: can agree 🙂
<d_bot>
<NULL> But I don't think it can realistically be changed
<d_bot>
<NULL> So it's just unfortunate
<d_bot>
<Et7f3> why less good ?
<d_bot>
<antron> i don't see how it's strictly less good. it follows the meaning of comparative adjectives
<companion_cube>
less good, or less or equal good?
<d_bot>
<Et7f3> 😦
<d_bot>
<antron> nice
<d_bot>
<NULL> At least in French it's somewhat ambiguous whether it is strict or not (though people tend to default to strict)
<d_bot>
<Et7f3> 😂
<companion_cube>
I do think >= is better than > as a "default"
<d_bot>
<antron> in english its unambigous, comparative adjectives denote strict comparisons
<d_bot>
<NULL> I know, and I think it is a bad convention, but one which cannot be realistically changed
<d_bot>
<Et7f3> even in french >= read "supérieur ou égal" and > "supérieur"
<CalimeroTeknik>
in math class, > is strict, is this true all over the world?
<CalimeroTeknik>
at least we have consistency
<d_bot>
<NULL> In practice, you say "plus grand que" which is ambiguous but usually refers to >= because that's the one people use
<d_bot>
<NULL> I'm pretty sure at least that is universal
<d_bot>
<Et7f3> britain and french disagree at least
<CalimeroTeknik>
really? "plus grand que" refers to > as I was taught in French
<companion_cube>
for me it was always ambiguous
<CalimeroTeknik>
alright
<d_bot>
<NULL> supérieur à is unambiguously >=
<d_bot>
<NULL> >**
<CalimeroTeknik>
yes, that much is true
<companion_cube>
and that's why symbols > words
<d_bot>
<NULL> In fact, I'm not so sure
<CalimeroTeknik>
in doubt, math teachers use "strictement supérieur" and "supérieur ou égal"
<d_bot>
<NULL> Yeah
<companion_cube>
yep
<d_bot>
<Et7f3> 🤔 Is paul taller than simon ?/Est-ce que paul est plus grand que simon ? I think we can answer: "No he is as tall as simon/Non il est aussi grand que" so event in french "plus grand que" should be ">"
<companion_cube>
to be fair I'm not that tal
<companion_cube>
l
<d_bot>
<Et7f3> 😂 (oops you revealer your real name)
<companion_cube>
no big secret here :)
<d_bot>
<NULL> I said somewhat ambiguous; some people wouldn't say being as tall is contradictory to being taller (in French, I am of those people)
<Armael>
big mistake!
<companion_cube>
oh no, now you can use magic on me, you know my real name
<d_bot>
<Et7f3> Hopefully we can translate many definitions with math symbol so it is less ambiguous