00:09
orbifx has quit [Quit: orbifx]
00:14
Haudegen has quit [Ping timeout: 272 seconds]
00:29
Tuplanolla has quit [Quit: Leaving.]
00:52
<
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?
00:52
<
ArthurStrong >
Like in Python? Or it's a limitation of static typing PLs?
00:53
dash has joined #ocaml
00:53
<
dash >
well, what do you mean by 'data structure'
00:54
<
ArthurStrong >
dash: a variable that is a list of lists of strings, for example
00:57
<
ArthurStrong >
Or I should specify data type explicitely for pretty-printing routine like Fmt?
01:10
<
sleepydog_ >
ArthurStrong: it is not generally possible but there are macros like ppx_deriving.show that will generate a pretty-printer for you
01:11
<
sleepydog_ >
it is also fairly easy to define them yourselves with the Fmt library
01:13
Asmadeus has joined #ocaml
01:15
sleepydog has joined #ocaml
01:20
<
ArthurStrong >
sleepydog: ah, I see. So this is a limitation of these PLs. LISP-like dynamic PLs can do this without macros, etc?
01:20
* ArthurStrong
not trolling
01:22
<
sleepydog >
other languages like java, Go, lisp, etc keep way more type information after compilation. OCaml discards almost everything
01:22
<
sleepydog >
the real world ocaml chapter on this helped me understand better, one sec
01:23
wreed has joined #ocaml
01:23
wreed has quit [Client Quit]
01:23
<
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
01:23
<
ArthurStrong >
sleepydog: thanks!
01:24
wreed has joined #ocaml
01:25
<
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
01:25
<
sleepydog >
in the final binary, that is
01:26
wreed has quit [Client Quit]
01:27
Asmadeus has left #ocaml [#ocaml]
01:28
ranu_ has quit [Quit: ranu_]
01:29
arecaceae has quit [Remote host closed the connection]
01:30
arecaceae has joined #ocaml
01:39
_whitelogger has joined #ocaml
01:40
<
dash >
well that's the historical norm, FORTRAN, C, etc all worked that way in general
01:40
rock64_ has quit [Ping timeout: 272 seconds]
01:42
<
sleepydog >
i guess that's true. C just left type checking as an exercise for the reader :)
01:42
rock64 has joined #ocaml
01:52
jsoo_ is now known as jsoo
02:32
ArthurStrong has quit [Ping timeout: 272 seconds]
02:42
ranu has joined #ocaml
02:47
delysin has quit [Quit: WeeChat 3.0.1]
02:57
delysin has joined #ocaml
03:09
mbuf has joined #ocaml
03:17
mfp has quit [Ping timeout: 256 seconds]
03:20
mxns has quit [Ping timeout: 272 seconds]
03:26
mxns has joined #ocaml
03:31
andreas303 has quit [Remote host closed the connection]
03:31
mxns has quit [Ping timeout: 272 seconds]
03:32
andreas303 has joined #ocaml
03:45
mxns has joined #ocaml
03:56
mxns has quit [Ping timeout: 246 seconds]
04:08
mxns has joined #ocaml
04:16
mxns has quit [Ping timeout: 240 seconds]
04:27
_whitelogger has joined #ocaml
04:29
mxns has joined #ocaml
04:34
mxns has quit [Ping timeout: 264 seconds]
04:42
mxns has joined #ocaml
04:49
ArthurStrong has joined #ocaml
05:03
ranu has quit [Quit: ranu]
05:23
mxns has quit [Ping timeout: 240 seconds]
05:23
zebrag has quit [Quit: Konversation terminated!]
05:37
<
ArthurStrong >
I wonder how many Poly/ML users here. Is there another channel for (S)ML dialects?
05:47
arecaceae has quit [Remote host closed the connection]
05:48
arecaceae has joined #ocaml
05:51
mxns has joined #ocaml
05:53
boxscape has quit [Ping timeout: 264 seconds]
05:56
mxns has quit [Ping timeout: 264 seconds]
06:00
ArthurStrong has quit [Quit: leaving]
06:09
mxns has joined #ocaml
06:13
Serpent7776 has joined #ocaml
06:13
mxns has quit [Ping timeout: 264 seconds]
06:26
narimiran has joined #ocaml
06:38
jlr has joined #ocaml
06:53
jlr has quit [Ping timeout: 272 seconds]
07:28
mxns has joined #ocaml
08:01
mxns has quit [Ping timeout: 264 seconds]
08:23
Haudegen has joined #ocaml
08:28
osa1 has quit [Read error: Connection reset by peer]
08:29
osa1 has joined #ocaml
08:51
borne has joined #ocaml
08:54
terrorjack has joined #ocaml
09:05
vsiles_ is now known as vsiles
09:16
olle has joined #ocaml
09:16
olle_ has joined #ocaml
09:36
osa1 has quit [Quit: osa1]
09:36
osa1 has joined #ocaml
09:44
catt has joined #ocaml
10:00
chripell has quit [Remote host closed the connection]
10:12
benc_ has joined #ocaml
10:34
jlr has joined #ocaml
10:37
chripell has joined #ocaml
10:43
bartholin has joined #ocaml
10:52
mbuf has quit [Remote host closed the connection]
10:52
mbuf has joined #ocaml
11:03
webshinra has joined #ocaml
11:12
benc_ has quit [Remote host closed the connection]
11:15
mfp has joined #ocaml
11:18
benc has joined #ocaml
11:19
ranu__ has joined #ocaml
11:24
boxscape has joined #ocaml
11:49
narimiran has quit [Ping timeout: 276 seconds]
11:58
mxns has joined #ocaml
12:03
mxns has quit [Ping timeout: 264 seconds]
12:10
reynir has quit [Read error: Connection reset by peer]
12:14
reynir has joined #ocaml
12:23
Haudegen has quit [Quit: Bin weg.]
12:59
mxns has joined #ocaml
13:04
mxns has quit [Ping timeout: 276 seconds]
13:43
sm2n has quit [Ping timeout: 264 seconds]
13:45
Haudegen has joined #ocaml
13:52
olle_ has quit [Ping timeout: 265 seconds]
13:52
olle has quit [Ping timeout: 265 seconds]
13:55
sm2n has joined #ocaml
14:09
mxns has joined #ocaml
14:13
zebrag has joined #ocaml
14:14
mxns has quit [Ping timeout: 240 seconds]
14:15
mxns has joined #ocaml
14:19
mxns has quit [Ping timeout: 240 seconds]
14:24
mxns has joined #ocaml
14:29
mxns has quit [Ping timeout: 272 seconds]
14:31
narimiran has joined #ocaml
14:37
mxns has joined #ocaml
14:42
mxns has quit [Ping timeout: 265 seconds]
14:47
borne has quit [Ping timeout: 272 seconds]
14:48
mxns has joined #ocaml
14:53
mxns has quit [Ping timeout: 272 seconds]
15:06
mxns has joined #ocaml
15:10
cartwright has joined #ocaml
15:11
cantstanya has quit [Remote host closed the connection]
15:13
jbrown has quit [Ping timeout: 240 seconds]
15:14
mxns has quit [Ping timeout: 260 seconds]
15:27
mxns has joined #ocaml
15:33
jlr has quit [Remote host closed the connection]
16:00
samoht[m] has quit [Quit: Idle for 30+ days]
16:18
Tuplanolla has joined #ocaml
16:40
jbrown has joined #ocaml
16:58
Haudegen has quit [Quit: Bin weg.]
17:23
mxns has quit [Ping timeout: 264 seconds]
17:31
mbuf has quit [Quit: Leaving]
17:36
boxscape has quit [Quit: Ping timeout (120 seconds)]
17:36
boxscape has joined #ocaml
17:40
vicfred has joined #ocaml
18:01
bartholin has quit [Quit: Leaving]
18:20
neiluj has joined #ocaml
18:20
neiluj has joined #ocaml
18:21
Haudegen has joined #ocaml
18:37
Anarchos has joined #ocaml
19:03
mxns has joined #ocaml
19:13
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
19:33
ArthurStrong has joined #ocaml
19:33
tryte has quit [Remote host closed the connection]
19:33
tryte has joined #ocaml
19:54
<
d_bot >
<Deadrat> ocaml-lsp on 4.12?
19:55
* ArthurStrong
wonders: how many Poly/ML users here? Is there another channel for (S)ML dialects?
19:57
arecaceae has quit [Remote host closed the connection]
19:58
arecaceae has joined #ocaml
20:01
<
companion_cube >
no idea ArthurStrong
20:01
<
bjorkint0sh >
ArthurStrong, there's #sml, but i think it's a soviet ghost town by now.
20:02
<
ArthurStrong >
bjorkint0sh: thanks
20:02
<
bjorkint0sh >
you know ... moscow ml... soviet ghost town? n/m.
20:02
<
ArthurStrong >
bjorkint0sh: do you mean, moscow ml abandoned?
20:02
<
bjorkint0sh >
the channel.
20:03
<
bjorkint0sh >
the sml channel.
20:03
<
companion_cube >
ArthurStrong: yep
20:03
<
ArthurStrong >
companion_cube: cool!
20:03
<
companion_cube >
^^
20:05
<
ArthurStrong >
I've been told I should first learn small ML languages, like SML. Before switching to OCaml
20:05
<
bjorkint0sh >
who told you that?
20:05
<
ArthurStrong >
well... friends :)
20:05
<
companion_cube >
"friends"
20:05
<
companion_cube >
:p
20:05
<
bjorkint0sh >
tell them, I said, you don't have to learn latin before learning spanish or any other romance language.
20:05
<
companion_cube >
honestly, just go with OCaml, it's not that big (if you ignore objects)
20:06
<
ArthurStrong >
companion_cube: OK, thanks for advice
20:06
<
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?
20:06
<
companion_cube >
I think modern OCaml tooling is also more helpful (like, LSP)
20:06
<
bjorkint0sh >
and it comes with batteries.
20:07
<
ArthurStrong >
OK. but Isabelle and HOL uses Poly/ML, because it's smaller language? Or? Why they can't switch to OCaml?
20:07
<
companion_cube >
for HOL I don't know
20:07
<
companion_cube >
HOL-light is in OCaml
20:07
<
companion_cube >
for Isabelle, they use really cool features of poly/ML that Ocaml doesn't have: on the fly native compilation, and multicore
20:07
<
bjorkint0sh >
ArthurStrong, what about coq? it's written in ocaml?
20:08
<
bjorkint0sh >
can't you use that?
20:08
<
ArthurStrong >
bjorkint0sh: Yeah, Coq is
20:09
<
companion_cube >
poly/ML seems to be an awesome implementation for a meta-language (HOL style)
20:09
<
companion_cube >
Coq doesn't do that anyway :)
20:10
<
companion_cube >
otoh it's very niche, bus factor of poly/ML is 1
20:11
<
ArthurStrong >
OK, thanks for your comments
20:11
<
Armael >
the knowledge that you get learning ocaml transfers very easily if one day you need to write some polyML for HOL, anyway
20:12
<
companion_cube >
that's true
20:12
<
companion_cube >
(although you'll miss some features)
20:26
averell has quit [Remote host closed the connection]
20:26
oriba has joined #ocaml
20:29
averell has joined #ocaml
20:29
averell has quit [Remote host closed the connection]
20:29
averell has joined #ocaml
20:43
zebrag has quit [Quit: Konversation terminated!]
20:43
zebrag has joined #ocaml
20:49
zebrag has quit [Quit: Konversation terminated!]
20:49
zebrag has joined #ocaml
20:50
zebrag has quit [Client Quit]
20:51
zebrag has joined #ocaml
20:55
richbridger has joined #ocaml
21:32
narimiran has quit [Quit: leaving]
21:43
tryte_ has joined #ocaml
21:44
tryte has quit [Ping timeout: 268 seconds]
22:06
mxns has quit [Ping timeout: 240 seconds]
22:06
sm2n has quit [Ping timeout: 240 seconds]
22:32
neiluj has quit [Quit: leaving]
22:33
mxns has joined #ocaml
22:43
catt has quit [Remote host closed the connection]
22:51
mxns has quit [Ping timeout: 276 seconds]
23:05
mxns has joined #ocaml
23:10
mxns has quit [Ping timeout: 264 seconds]
23:39
sm2n has joined #ocaml
23:49
sm2n_ has joined #ocaml
23:52
sm2n has quit [Ping timeout: 264 seconds]
23:53
sm2n has joined #ocaml
23:54
sm2n_ has quit [Ping timeout: 240 seconds]