[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
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