Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
mbuf has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
hendursaga has quit [Ping timeout: 276 seconds]
hendursaga has joined #ocaml
[itchyjunk] has quit [Read error: Connection reset by peer]
wwilly has quit [Ping timeout: 245 seconds]
gravicappa has joined #ocaml
xiongxin has joined #ocaml
Haudegen has joined #ocaml
wwilly has joined #ocaml
glassofethanol has joined #ocaml
vsiles has quit [Remote host closed the connection]
vsiles has joined #ocaml
hendursa1 has joined #ocaml
hendursaga has quit [Ping timeout: 276 seconds]
xiongxin has quit [Ping timeout: 245 seconds]
vb has quit [Ping timeout: 260 seconds]
vb has joined #ocaml
mro has joined #ocaml
olle has joined #ocaml
xiongxin has joined #ocaml
octachron_ is now known as octachron
bartholin has joined #ocaml
wwilly has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
kakadu has joined #ocaml
mro has quit [Remote host closed the connection]
Haudegen has joined #ocaml
mro has joined #ocaml
mro has quit [Client Quit]
<Drup> cemerick: if it's for pulling data out of HTML, use lambda-soup.
<Drup> Analyzing and creating HTML are two very different problems. In the immortal moto of "be conservative in what you do, be liberal in what you accept" and given we are working on HTML that is by existance of the web 99% of the time incorect, analyzing must have a very loose view on typing.
<cemerick> Drup: I mean, I did. I don't think a typed tree representation dictates anything about it being write-only though
<Drup> Actually, kind-of: it's one of the price of using encoding to check complex properties in types, and it's not unique to tyxml to have limited "decoding" capabilities
<Drup> In fact, if you were to write down a `children` function, which type would you give it, and would that type be useful to you for analyzing HTML ?
[itchyjunk] has joined #ocaml
<d_bot> <Koni> hlo
gravicappa has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
hackinghorn has quit [Quit: Leaving]
spip has quit [Ping timeout: 264 seconds]
zebrag has joined #ocaml
hendursa1 has quit [Remote host closed the connection]
hendursa1 has joined #ocaml
<cemerick> Drup: oh-kay, `toelt` is what I was looking for; lets me use the Iterable stuff, etc. A CSS/xpath-esque facility is academic from there.
<Drup> you can easily obtain the underlying untyped representation, yes
<cemerick> I suppose I wasn't clear before; I was never looking for the typed invariants to hold on the access side
<companion_cube> doesn't tyxml have a type parameter for children anyway? :)
<Drup> companion_cube: precisely, no.
<companion_cube> like "star" or whatever? no?
<Drup> That's just the type of the constructors
<companion_cube> of course the children might be one of many concrete types
<Drup> In `'a Html.elt`, `'a` specifies the element
<companion_cube> oh I see.
<companion_cube> it'd be too recursive otherwise I guess
<Armael> lambda-soup has selectors stuff fwiw
<d_bot> <__attribute__((outlaw))> hey is it possible to compile ocaml to native machine code ?
<olle> Yes
<Drup> cemerick: We currently don't really have a bridge back to lambda-soup mostly because ... that's kinda weird ? If you built the HTML, you already have the underlying values. If your HTML comes from lambda-soup, you don't have to pass it in tyxml to analyze it
<d_bot> <__attribute__((outlaw))> how ?
<Drup> Hence my question about your use-case: where does your html comes from, so that it's in tyxml but you don't already know what it's made of ?
gravicappa has joined #ocaml
<cemerick> Drup: no, I wouldn't expect such a bridge. But the real world being what it is, there's too many cases where I might have some external source of HTML (maybe whole documents, maybe just snippets) that I need to either integrate with "internal" (i.e. well-typed, when using tyxml) HTML.
<Drup> ah yes, in that's case it's lambda-soup -> tyxml
<Drup> we ... don't have that explicitely, but you can make it easily
<Drup> it's "officially" supported, let's say :3
<cemerick> heh, well, sometimes it needs to go the other way around
<Drup> hence my question: when ? :D
<Drup> cemerick: would that help: https://github.com/ocsigen/tyxml/pull/223 ?
waleee has quit [Ping timeout: 260 seconds]
xiongxin has quit [Quit: No Ping reply in 180 seconds.]
xiongxin has joined #ocaml
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #ocaml
<cemerick> I think you think I *want* to use soup for some reason?
<companion_cube> cause it's the only robust parser, no?
<cemerick> I mean, I may yet, just because it might be easier to make a ppx and pleasant html-writing funs for soup than it would be to write a decent selector impl for Tyxml.Xml
<cemerick> companion_cube: I'm rarely ever consuming suspect HTML, generally outputs from well-behaved services and e.g. markdown renderers or whatever
<companion_cube> hmm, there's soupault I think
<companion_cube> not sure if it's what you want
<Drup> cemerick: well, in my head, the "right" setup is the following:
<Drup> - You get your external HTML with lambda soup
<Drup> - You inject the extracted external HTML from lambda-soup into tyxml, and combine it with the internal HTML in tyxml.
<Drup> - You build your internal HTML with tyxml
<Drup> (when I say lambda-soup, it's actually markup+lambdasoup)
<Drup> the injection is relatively easy using `Tyxml.Html.of_seq`
<Drup> if that setup doesn't suit you, I would like to understand why :p
<Drup> I wouldn't mind having decent selectors for `Tyxml.Xml` ... but lambdasoup does that strictly better, and ideally I would prefer ensuring easy delegation
<smondet[m]> There'd be value I think in a more "pure" soup-like module.
<smondet[m]> (I started using lambdasoup something but past the simple examples, the "everything is mutable" ended-up exploding in my face, I went back to just `markup` + a pure xml-tree)
<cemerick> companion_cube: not doing any static sites at the moment, but neat to know that that's available
<cemerick> Drup: especially when pushing around RDFa, the largest body of content is almost always coming from somewhere else, and the task is to modify it in the right places before sending it on its way.
<cemerick> ofc it makes all the sense in the world to construct those additions in a typesafe way as possible
<cemerick> smondet[m]: agreed, the mutability of soup is a big strike against it IMO
spip has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 245 seconds]
<d_bot> <darrenldl> dune exe targets would give you native machine code i think
<d_bot> <__attribute__((outlaw))> I figured it out
<d_bot> <__attribute__((outlaw))> ocamlopt
<d_bot> <__attribute__((outlaw))> but thx
<companion_cube> just use dune
Haudegen has quit [Quit: Bin weg.]
<d_bot> <darrenldl> ^ not really worth figuring out the full ocamlopt command since dune will likely do it better than you
<d_bot> <__attribute__((outlaw))> ocamlopt -o main main.ml
<d_bot> <__attribute__((outlaw))> lol
<companion_cube> that only works if you have one file and 0 deps
xiongxin has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<d_bot> <__attribute__((outlaw))> well for multiple files you put the file names as list that's it
<d_bot> <__attribute__((outlaw))> idk about deps yet though
[itchyjunk] has quit [Quit: Leaving]
<companion_cube> I mean, you do you
<d_bot> <darrenldl> time spent in writing ocamlopt command can be better spent elsewhere
<companion_cube> but dune is specifically designed to handle all that for you
<companion_cube> including incremental compilation, dependencies, ppx, etc.
CodeBitCookie[m] has quit [Ping timeout: 246 seconds]
CodeBitCookie[m] has joined #ocaml
<d_bot> <__attribute__((outlaw))> yup I get what you mean
<d_bot> <__attribute__((outlaw))> I'm new to ocaml so I'm trying to understand how everything works
<d_bot> <__attribute__((outlaw))> that's why I started with using the supplied toolchain
<d_bot> <darrenldl> eh, at some point you just gotta have to give up on fully getting the low level details
<d_bot> <darrenldl> in terms of supplied toolchain, dune is the standard option nowadays
<d_bot> <__attribute__((outlaw))> I see
glassofethanol has quit [Quit: leaving]
olle has quit [Ping timeout: 252 seconds]
hannes__ is now known as hannes
rond_ has joined #ocaml
<d_bot> <rgrinberg> You can always look at what dune runs in the build log. No detail is hidden from the curious 🙂
rond_ has quit [Quit: Client closed]
Tuplanolla has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
jaitoon has joined #ocaml
Haudegen has joined #ocaml
bartholin has quit [Quit: Leaving]
mbuf has quit [Quit: Leaving]
ulyssa has quit [Remote host closed the connection]
ulyssa has joined #ocaml
vicfred has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
waleee has joined #ocaml
cedric has joined #ocaml
bobo has quit [Ping timeout: 252 seconds]
<d_bot> <EduardoRFS> well not if you have enough time
gravicappa has quit [Ping timeout: 252 seconds]
jaitoon has quit [Ping timeout: 250 seconds]
rom15041 is now known as rom1504
wilfred has joined #ocaml
bronsen has quit [Ping timeout: 252 seconds]
jaitoon has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
cedric has quit [Quit: Konversation terminated!]
Haudegen has quit [Ping timeout: 245 seconds]
waleee has quit [Quit: WeeChat 3.3]
waleee has joined #ocaml