companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
<dh`> s/render file/render fine/
companion_cube has quit [Server closed connection]
companion_cube has joined #ocaml
masterbuilder has joined #ocaml
sadiq has quit [*.net *.split]
tomku has quit [*.net *.split]
ebb has quit [*.net *.split]
hexology has quit [*.net *.split]
sadiq has joined #ocaml
tomku has joined #ocaml
tomku has quit [Changing host]
tomku has joined #ocaml
hexology has joined #ocaml
ebb has joined #ocaml
chrisz has quit [Ping timeout: 255 seconds]
chrisz has joined #ocaml
<discocaml> <hockletock> it is a deliberate decision by the discuss developers, they turn EVERYTHING off even in a JS browser that isn't on their list of supported browsers
waleee has quit [Ping timeout: 245 seconds]
habnabit_ has quit [Quit: ZNC - http://znc.sourceforge.net]
habnabit_ has joined #ocaml
<dh`> if they did that, it'd just generate a blank page like the usual js issues
bartholin has joined #ocaml
azimut has joined #ocaml
Serpent7776 has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
mima has joined #ocaml
myrkraverk has quit [Read error: Connection reset by peer]
myrkraverk_ has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 255 seconds]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
dnh has joined #ocaml
Anarchos has joined #ocaml
amk has quit [Ping timeout: 246 seconds]
amk has joined #ocaml
bartholin has quit [Quit: Leaving]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
dnh has quit [Ping timeout: 258 seconds]
rgrinberg has joined #ocaml
dnh has joined #ocaml
rwmjones_ is now known as rwmjones
dnh has quit [Ping timeout: 258 seconds]
dnh has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
spip has joined #ocaml
mima has quit [Ping timeout: 260 seconds]
amk has quit [Ping timeout: 255 seconds]
amk has joined #ocaml
waleee has joined #ocaml
mima has joined #ocaml
azimut has quit [Write error: Connection reset by peer]
azimut has joined #ocaml
dnh_ has joined #ocaml
dnh has quit [Ping timeout: 245 seconds]
uncomfy has joined #ocaml
uncomfy has quit [Remote host closed the connection]
<companion_cube> idk, I just opened it in epiphany, it works
<companion_cube> even in ladybird
xgqt has quit [Quit: WeeChat 3.7.1]
xgqt has joined #ocaml
Anarchos has joined #ocaml
ctk has quit [Changing host]
ctk has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
spip has quit [Quit: Konversation terminated!]
rgrinberg has joined #ocaml
mima has quit [Quit: leaving]
dnh_ has quit [Ping timeout: 255 seconds]
dnh has joined #ocaml
dnh has quit [Ping timeout: 246 seconds]
dnh has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bartholin has joined #ocaml
ctk is now known as CalimeroTeknik
<toastal> JavaScript is usually the vector for malicious content & tracking. Browsing with JS disabled by default is safer for users willing to “deal” with allowlisting sites.
<toastal> JavaScript rendered sites tend to have issues with SEO. If you’ve ever had X11 break, you will have a great appreciation for the web that still works without JS too.
<technomancy> yeah; I only block 3rd-party scripts but it still breaks
<toastal> If you’re not posting something interactive, meaning it’s purpose is informational (blog posts, documentation, etc.) then aiming for the widest ease of use is a better experience for users, crawlers, & maybe aliens.
<technomancy> that's pretty bad; even if it "requires" scripting there's no reason to load anything external, plus it doesn't even show an error message, just eternal "loading"
<toastal> Beginner Q: is there such thing as having a default record for values & and ergonomic syntax around that?
<technomancy> omg 104 scripts blocked; wow
<toastal> In Dhall, Nickel, etc. I may want a bunch of options to be set to None/Nothing…
<discocaml> <._null._> toastal: you mean default values for record fields ?
<toastal> yes I think. My terminology isn’t here yet for this language.
<toastal> Or is it better/more idiomatic use open-ended records and leave off keys?
<discocaml> <._null._> There isn't, the only optional things are optional arguments, but you can wrap record construction with such a function
<discocaml> <._null._> What do you mean with open-ended records ?
<discocaml> <._null._> You can't leave out fields in OCaml records
<toastal> in PureScript I might have type Foo row = ( Bar ∷ Unit | row )
<toastal> Extensible rows?
<toastal> Eh, working with rows like this is usually more trouble than it’s worth now that I’ve rubber duck’d
<discocaml> <._null._> OCaml supports row polymorphism through its objects, but those are rarely used
<toastal> re JS: at a bare minimum, provide a <noscript> that describes what is on the page or in the widget as a blank page seems like an error & doesn’t inspire me to consent to scripts.
<toastal> ._null._: thanks
<discocaml> <Et7f3 (@me on reply)> { def with f1 = 4; f2 = 7; } with def a record already filled ?
<discocaml> <Et7f3 (@me on reply)> @toastal
<toastal> Unsure what that means
<toastal> This syntax. It is def the default record, and with f1 & f2 overriding def’s default values, yeah?
<discocaml> <._null._> If all of your fields have default values, you can construct the record `default` with all its values default, and then you can construct new ones setting only some fields
<discocaml> <._null._> `{ default with f1 = 4}`
<toastal> I can try that out.
<toastal> Are there recursive record references? Like Nix you can let foo = rec { bar = 1; baz = bar + 2; };
<discocaml> <._null._> There's no "virtual field" though, so you can't leave any field out in the default record
<discocaml> <Et7f3 (@me on reply)> Yes
<toastal> ._null._ gotcha
<discocaml> <._null._> Et7f3: No ?
<toastal> Those answers conflict 😅
<discocaml> <._null._> You can always test it easily in a REPL
<toastal> Sometimes. When asking about syntax features, you don’t know until you know :)
<discocaml> <._null._> But usually, you would write it like `let foo = let bar = 1 in { bar; baz = bar+1 }` thanks to field name punning
<toastal> ah
<toastal> punning I understand!
<toastal> A few more getting-my-bearing moments & this should feel as natural as any of the other MLs I’ve spent time with.
<discocaml> <._null._> Ok, you wouldn't be able to guess it if a keyword was required, I didn't think of that possibility
<discocaml> <._null._> (Reply to 4 messgaes ago)
<toastal> I’m not doing something all that complicated… I just want to reduce as much noise as possible for myself & possibly future readers (which includes myself)
<discocaml> <._null._> Reasonable objective
<toastal> When doing this sort of record + defaults, do folks usually create a small module with t type and default = { … }?
<toastal> so let Bar : Foo.t = { Foo.default with baz = 1 }
<discocaml> <._null._> I can't tell, my use case is usually stuff like `fun record v2 -> { record with f2 = v2 }`
<discocaml> <._null._> You can't name your record `Bar`, capitalised idents are reserved for constructors and modules
<toastal> ha right on
<discocaml> <._null._> Your idea doesn't seem unreasonable at least
<toastal> That’s the way Dhall does it. There’s even syntax which would be let Bar : Foo.Type = Foo::{ baz = 1 } as a shorthand for let Bar : Foo.Type = Foo.default ⫽ { baz = 1 }
<toastal> but it requires your little record has fields Type with a Type and default with an implementation :P
<toastal> Nickel you have a default keyword you can put in any record.
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
xd1le_ has quit [Ping timeout: 245 seconds]
xd1le has joined #ocaml
<discocaml> <Et7f3 (@me on reply)> see:
<discocaml> <Et7f3 (@me on reply)> ```OCaml
<discocaml> <Et7f3 (@me on reply)> type cycle = { c: cycle; i: int; };;
<discocaml> <Et7f3 (@me on reply)> let rec cyc = { c = cyc; i = 3; };;
<discocaml> <Et7f3 (@me on reply)> ```
Tuplanolla has joined #ocaml
<discocaml> <Et7f3 (@me on reply)> Ah you can't use cyc.something 🤔
yziquel has joined #ocaml
<yziquel> Hi. Got a problem.
<yziquel> I'm building the quasi-defunct atomspace repo from quasi-defunct OpenCog. It fails with an #include <caml/alloc.h> for some C++ code built with CMake.
<yziquel> This is likely an instance of "it builds on my machine" (i.e. Linas Vepstas' machine). But it doesn't build out of the box on an ubuntu 22 with apt install ocaml performed.
<yziquel> Any code sample of C++ code built against caml/alloc.h with cmake that works on ubuntu with ocaml installed via apt would be more than welcome.
<yziquel> (To see where the problem comes from. I'm not that conversant with the CMake + OCaml combo.)
<companion_cube> it feels like the object system is a bit unpolished…
<companion_cube> after last time with the virtual methods having to be repeated in a class that implements it
<companion_cube> (in the .mli)
<companion_cube> now I find myself wondering why a virtual class or a class can't say "inherit" or "implement" a class type
<companion_cube> feels like a class type should just be a purely virtual class?
<yziquel> companion_cube last time I checked, OCaml's OO system follows duck typing. Which is quite different from usual OO notions of inheritance. Usual OO notions of inheritance is more like the module system.
<yziquel> companion_cube but I haven't coded in OCaml in ages.
<companion_cube> it absolutely also has inheritance
<companion_cube> there's some structural typing, but _also_ classes
<yziquel> yes
<yziquel> just doesn't quite work the same way as in OO. May have changed in the last 10 years.
<companion_cube> I mean is it not OO?
<companion_cube> inheritance works, it's just… there's places where it seems weirdly verbose :/
<yziquel> companion_cube it's been too long since I tried it out to have an informed opinion of the state it is at.
<octachron> companion_cube, the class system has indeed fallen quickly out-of-focus in term of new features (while the code has been maintained/refactored/simplified). It looks like there was one new feature in OCaml 3.
<companion_cube> yeah…
<octachron> (and none in OCaml 4)
Anarchos has joined #ocaml
<companion_cube> there's already a lot in there, but idk if anyone really uses it thoroughly :)
<companion_cube> maybe fpottier in visitors?
<yziquel> opam install cmdliner says it is installed. The ./configure script of opam itself says it can't find it. weird.
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yziquel has quit [Quit: Client closed]
rgrinberg has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
yziquel has joined #ocaml
Serpent7776 has quit [Ping timeout: 248 seconds]
azimut has quit [Ping timeout: 246 seconds]
<yziquel> this opam package depends on g++. opam says it can't find it. it is installed on my ubuntu system. how do i solve this ?
bartholin has quit [Quit: Leaving]
Tuplanolla has quit [Quit: Leaving.]
yziquel has quit [Quit: Client closed]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emp_ has joined #ocaml
emp has quit [Ping timeout: 246 seconds]
chrisz has quit [Ping timeout: 258 seconds]
chrisz has joined #ocaml
yziquel has joined #ocaml
<companion_cube> Opencog, hu... Haven't seen that in a long time. The hypergraph thing?