<d_bot>
<theangryepicbanana> man I really want to redo all of the syntax highlighting, but I'm also busy with school -_-
<d_bot>
<undu> I encourage you to do a tree-sitter parser for it, It's quite easy to integrate those into neovim and get structural, fast highlighting. It can be plugged into atom, I think there was a plugin for vscode as well.
QDX45 has joined #ocaml
<QDX45>
Hi, is this a good place to ask a question about opam?
<d_bot>
<theangryepicbanana> I'm not totally familiar with tree-sitter, but I didn't seem to get much information about it when I did look into it. I'd probably just revamp/redo the grammar itself
<d_bot>
<theangryepicbanana> (as a side note, I don't know anything about neovim lol)
<d_bot>
<Kate> QDX45: sure, ask away.
<d_bot>
<theangryepicbanana> I've done a lot of syntax highlighting stuff before, so I don't think it'd be *too* hard I don't think
Tuplanolla has quit [Quit: Leaving.]
<QDX45>
Well, here goes. I think I need to compile a package manually, and then make it visible to opam.
<QDX45>
I'm not sure how to do that.
<QDX45>
I have a litany of packages to install, and one of the dependencies for one of those is broken. Weird complilation errors.
<QDX45>
So for that package, I've manage to compile it by hand, cloning the git repo and building it that way - but now I need opam to see that package so it can use it as a dependency.
<QDX45>
I'm not sure how to do that.
<companion_cube>
maybe `opam pin` would work
<companion_cube>
pin either the package's github, or local repo, or local path
<companion_cube>
(it has to be an opam package though)
<QDX45>
It's definitely an opam package, in the sense that I can theoretically get it from 'opam install'
<companion_cube>
if you can opam install it, just do that I guess]
<QDX45>
I don't see how `opam pin` would help opam see the package in the first place
<companion_cube>
that was because i wasn't sure it was packaged
<companion_cube>
anyway
<QDX45>
The problem is I can't opam install it.
panda69 has joined #ocaml
<QDX45>
So I went to the source and compiled it there
<companion_cube>
it's not normal that it fails on `opam install` and works locally
<companion_cube>
is it the same version? or a release vs `master`?
<QDX45>
I had to edit a couple files to make it compile
<companion_cube>
ah, there you go
<QDX45>
yeah
<companion_cube>
you must commit that and `opam pin` the local repo
<companion_cube>
I mean, it's by far the simplest
<companion_cube>
this way opam will use the modified version
<QDX45>
Oh, ok. So I can tell opam about arbitrary repos and it'll use those as package sources?
<QDX45>
That makes sense
<companion_cube>
yes!
<QDX45>
Thanks!
<panda69>
Hi, I have a code quality question: I have a "point" module with something like x and y. In a different module, I want to create functions, say "f p = p.x + p.y". I can either do "open Point" and then write what I just wrote, or I can not do that and do "f p = p.Point.x + p.Point.y". But I know it's not good practice to just open everything you
<panda69>
need, so what do you guys recommend?
<companion_cube>
`opam pin /some/local/repo/#HEAD` typically for me
<QDX45>
That helps a lot :)
<companion_cube>
(tells opam it's a git repo)
<companion_cube>
it's very useful for development indeed!
vicfred has quit [Quit: Leaving]
<QDX45>
nice!
<companion_cube>
panda69: `Point.( p.x + p.y )` also works
<companion_cube>
it's a local open
<companion_cube>
much cleaner than a toplevel one in general
<panda69>
oh i didn't know that!
<companion_cube>
super useful with, say, zarith (GMP bindings)
<companion_cube>
`Z.(x + y * one)`
<companion_cube>
same as `Z.(+) x (Z.( * ) y Z.one)`
<panda69>
so i did this and it seemed to work :o [| [| tuple.Tuple.x |]; [| tuple.y |]; [| tuple.z |]; [| tuple.w |] |]
<panda69>
sounds like it infers the Tuple.y z and w?
<companion_cube>
yep, that's another way
<companion_cube>
also: `let f (p:Point.t) = p.x + p.y`
<companion_cube>
(my favorite, in general, I like to annotate types)
<panda69>
oh nice did not know those existed
<panda69>
coming from haskell, was very confused when i saw functions without type declarations
<panda69>
haha
<panda69>
can I do an unpacking with this somehow?
<panda69>
eg i have "type ray = {origin: Tuple.tuple; direction: Tuple.tuple}" in some class
<panda69>
and i'd like to do "let {origin; direction} = .." in another class
<companion_cube>
what do you mean by 'class' ?
<companion_cube>
module?
<companion_cube>
`type ray = {origin: Tuple.t; direction: Tuple.t}` in a.ml
<companion_cube>
in b.ml, `let {A.origin; direction} = …` in b.ml
<d_bot>
<darrenldl> the authors answer seem to imply it's about implementation of stack at assembly level in the context of the book(?
<d_bot>
<darrenldl> my first immediate reaction was along the lines of stack as in "network stack" or "tech stack" though
vicfred has joined #ocaml
<companion_cube>
what stack?
vicfred has quit [Max SendQ exceeded]
<companion_cube>
there's a bit of context missing there :p
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
panda69 has quit [Remote host closed the connection]
steenuil has quit [Read error: Connection reset by peer]
<companion_cube>
ah it's the control stack, for function calls, it seems
<companion_cube>
the way recursion is implemented, in particular, relies on the stack (except for tail recursion)
<QDX45>
Where can I find the package 'ocamldoc'?
<QDX45>
I'm on alpine, and it's not available through the standard repos
<QDX45>
...nevermind.
<QDX45>
Finally figured it out, right after asking. :/
<d_bot>
<darrenldl> > ah it's the control stack, for function calls, it seems
<d_bot>
<darrenldl> aha right, control stack, my assembly is beyond rusty to even recall that term haha
nullcone has quit [Quit: Connection closed for inactivity]
mfp has quit [Ping timeout: 240 seconds]
borne has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
f[x] has quit [Remote host closed the connection]
Jeanne-Kamikaze has quit [Quit: Leaving]
borne has quit [Ping timeout: 260 seconds]
borne has joined #ocaml
vicfred has quit [Quit: Leaving]
waleee-cl has quit [Quit: Connection closed for inactivity]
borne has quit [Ping timeout: 264 seconds]
narimiran has joined #ocaml
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
shawnw has joined #ocaml
osa1_ has joined #ocaml
<d_bot>
<undu> That's the point of tree-sitter, implement the grammar, then enrich the nodes with metadata so it can be used for the functionality needed by the application (like highlighting). This enrichment is done with application-specific s-expressions: https://www.github.com/nvim-treesitter/nvim-treesitter/tree/master/queries%2Focaml
osa1_ has quit [Quit: osa1_]
Haudegen has joined #ocaml
borne has joined #ocaml
<d_bot>
<oleg_p> could anyone help my bad assembly knowledge on this one ?
<d_bot>
<joris> The plugin works. But I think we need to define some queries for ocaml
<d_bot>
<joris> The plugin works wonderfully for rust
<d_bot>
<joris> So far only function object seems to kind of work
<d_bot>
<undu> it needs the queries for ocaml. they should be added as `queries/ocaml/textobjects.scm` I never got around doing them because I don't know what is their purpose. I did the other ocaml queries by looking at queries for other languages for textobjects and comparing them with ecisting wuries for ocaml
<d_bot>
<joris> i'll have a look
<d_bot>
<joris> the purpose is great btw, it is a bit like Merlin/ocamllsp shrink/expand selection, but with name. So in neovim you do for instance you do vam:s/foo/bar/ and boom, you get replacement inside the current module (provided the module body text object is defined, and is bound to m)
gareppa has quit [Quit: Leaving]
<d_bot>
<joris> Basically extends traditional vim motions like word sentence and paragraph with syntax aware objects