companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
orbifx has quit [Quit: orbifx]
Haudegen has quit [Ping timeout: 272 seconds]
Tuplanolla has quit [Quit: Leaving.]
<ArthurStrong> Hi all. Dear lazyweb, is it possible to devise a function in OCaml that just pretty print a data structure that is unknown at compile time?
<ArthurStrong> Like in Python? Or it's a limitation of static typing PLs?
dash has joined #ocaml
<dash> well, what do you mean by 'data structure'
<ArthurStrong> dash: a variable that is a list of lists of strings, for example
<ArthurStrong> Or I should specify data type explicitely for pretty-printing routine like Fmt?
<sleepydog_> ArthurStrong: it is not generally possible but there are macros like ppx_deriving.show that will generate a pretty-printer for you
<sleepydog_> it is also fairly easy to define them yourselves with the Fmt library
sleepydog_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
Asmadeus has joined #ocaml
sleepydog has joined #ocaml
<ArthurStrong> sleepydog: ah, I see. So this is a limitation of these PLs. LISP-like dynamic PLs can do this without macros, etc?
* ArthurStrong not trolling
<sleepydog> other languages like java, Go, lisp, etc keep way more type information after compilation. OCaml discards almost everything
<sleepydog> the real world ocaml chapter on this helped me understand better, one sec
wreed has joined #ocaml
wreed has quit [Client Quit]
<dash> yeah the type of the data structure is known at compile time, it's possible to generate code that formats it the way you like
<ArthurStrong> sleepydog: thanks!
wreed has joined #ocaml
<sleepydog> while it's a little inconvenient, i think it's amazing that ocaml can verify the program so well during compilation that it can get rid of most type information
<sleepydog> in the final binary, that is
wreed has quit [Client Quit]
Asmadeus has left #ocaml [#ocaml]
ranu_ has quit [Quit: ranu_]
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
_whitelogger has joined #ocaml
<dash> well that's the historical norm, FORTRAN, C, etc all worked that way in general
rock64_ has quit [Ping timeout: 272 seconds]
<sleepydog> i guess that's true. C just left type checking as an exercise for the reader :)
rock64 has joined #ocaml
jsoo_ is now known as jsoo
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
ArthurStrong has quit [Ping timeout: 272 seconds]
ranu has joined #ocaml
delysin has quit [Quit: WeeChat 3.0.1]
delysin has joined #ocaml
mbuf has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
andreas303 has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 272 seconds]
andreas303 has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
ArthurStrong has joined #ocaml
ranu has quit [Quit: ranu]
mxns has quit [Ping timeout: 240 seconds]
zebrag has quit [Quit: Konversation terminated!]
<ArthurStrong> I wonder how many Poly/ML users here. Is there another channel for (S)ML dialects?
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
mxns has joined #ocaml
boxscape has quit [Ping timeout: 264 seconds]
mxns has quit [Ping timeout: 264 seconds]
ArthurStrong has quit [Quit: leaving]
mxns has joined #ocaml
Serpent7776 has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
narimiran has joined #ocaml
jlr has joined #ocaml
schlaftier has quit [Quit: The Lounge - https://thelounge.chat]
jlr has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
osa1 has quit [Read error: Connection reset by peer]
osa1 has joined #ocaml
borne has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
vsiles_ is now known as vsiles
olle has joined #ocaml
olle_ has joined #ocaml
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
catt has joined #ocaml
chripell has quit [Remote host closed the connection]
benc_ has joined #ocaml
jlr has joined #ocaml
chripell has joined #ocaml
bartholin has joined #ocaml
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
webshinra has joined #ocaml
benc_ has quit [Remote host closed the connection]
mfp has joined #ocaml
benc has joined #ocaml
ranu__ has joined #ocaml
boxscape has joined #ocaml
narimiran has quit [Ping timeout: 276 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
reynir has quit [Read error: Connection reset by peer]
reynir has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mxns has joined #ocaml
mxns has quit [Ping timeout: 276 seconds]
sm2n has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
olle_ has quit [Ping timeout: 265 seconds]
olle has quit [Ping timeout: 265 seconds]
sm2n has joined #ocaml
mxns has joined #ocaml
zebrag has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
narimiran has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
borne has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
cartwright has joined #ocaml
cantstanya has quit [Remote host closed the connection]
jbrown has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
jlr has quit [Remote host closed the connection]
samoht[m] has quit [Quit: Idle for 30+ days]
benc has quit []
Tuplanolla has joined #ocaml
jbrown has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mxns has quit [Ping timeout: 264 seconds]
mbuf has quit [Quit: Leaving]
boxscape has quit [Quit: Ping timeout (120 seconds)]
boxscape has joined #ocaml
vicfred has joined #ocaml
bartholin has quit [Quit: Leaving]
neiluj has joined #ocaml
neiluj has joined #ocaml
Haudegen has joined #ocaml
Anarchos has joined #ocaml
mxns has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
ArthurStrong has joined #ocaml
tryte has quit [Remote host closed the connection]
tryte has joined #ocaml
<d_bot> <Deadrat> ocaml-lsp on 4.12?
* ArthurStrong wonders: how many Poly/ML users here? Is there another channel for (S)ML dialects?
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
<companion_cube> no idea ArthurStrong
<bjorkint0sh> ArthurStrong, there's #sml, but i think it's a soviet ghost town by now.
<ArthurStrong> companion_cube: is this you? https://github.com/c-cube
<ArthurStrong> bjorkint0sh: thanks
<bjorkint0sh> you know ... moscow ml... soviet ghost town? n/m.
<ArthurStrong> bjorkint0sh: do you mean, moscow ml abandoned?
<bjorkint0sh> the channel.
<bjorkint0sh> the sml channel.
<companion_cube> ArthurStrong: yep
<ArthurStrong> companion_cube: cool!
<companion_cube> ^^
<ArthurStrong> I've been told I should first learn small ML languages, like SML. Before switching to OCaml
<bjorkint0sh> who told you that?
<ArthurStrong> well... friends :)
<companion_cube> "friends"
<companion_cube> :p
<bjorkint0sh> tell them, I said, you don't have to learn latin before learning spanish or any other romance language.
<companion_cube> honestly, just go with OCaml, it's not that big (if you ignore objects)
<ArthurStrong> companion_cube: OK, thanks for advice
<bjorkint0sh> as a matter of fact, the native speakers of the romance language, don't learn latin unless they're made to. why should you?
<companion_cube> I think modern OCaml tooling is also more helpful (like, LSP)
<bjorkint0sh> and it comes with batteries.
<ArthurStrong> OK. but Isabelle and HOL uses Poly/ML, because it's smaller language? Or? Why they can't switch to OCaml?
<companion_cube> for HOL I don't know
<companion_cube> HOL-light is in OCaml
<companion_cube> for Isabelle, they use really cool features of poly/ML that Ocaml doesn't have: on the fly native compilation, and multicore
<bjorkint0sh> ArthurStrong, what about coq? it's written in ocaml?
<bjorkint0sh> can't you use that?
<ArthurStrong> https://hol-theorem-prover.org/ - they recommend Poly/ML
<ArthurStrong> bjorkint0sh: Yeah, Coq is
<companion_cube> poly/ML seems to be an awesome implementation for a meta-language (HOL style)
<companion_cube> Coq doesn't do that anyway :)
<companion_cube> otoh it's very niche, bus factor of poly/ML is 1
<ArthurStrong> OK, thanks for your comments
<Armael> the knowledge that you get learning ocaml transfers very easily if one day you need to write some polyML for HOL, anyway
<companion_cube> that's true
<companion_cube> (although you'll miss some features)
averell has quit [Remote host closed the connection]
oriba has joined #ocaml
averell has joined #ocaml
averell has quit [Remote host closed the connection]
averell has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
zebrag has joined #ocaml
richbridger has joined #ocaml
narimiran has quit [Quit: leaving]
tryte_ has joined #ocaml
tryte has quit [Ping timeout: 268 seconds]
mxns has quit [Ping timeout: 240 seconds]
sm2n has quit [Ping timeout: 240 seconds]
neiluj has quit [Quit: leaving]
mxns has joined #ocaml
catt has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 276 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
sm2n has joined #ocaml
sm2n_ has joined #ocaml
sm2n has quit [Ping timeout: 264 seconds]
sm2n has joined #ocaml
sm2n_ has quit [Ping timeout: 240 seconds]