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
Haudegen has quit [Ping timeout: 240 seconds]
amiloradovsky has quit [Remote host closed the connection]
borne has quit [Ping timeout: 260 seconds]
mxns has quit [Ping timeout: 272 seconds]
Jeanne-Kamikaze has joined #ocaml
<d_bot> <theangryepicbanana> why doesn't vscode support the new menhir syntax 😦
<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]
<d_bot> <darrenldl> the book (https://github.com/sayon/low-level-programming/blob/master/questions/answers/004.md) seems to be referring to the data structure stack, but i'm very unfamiliar with how the term "stack" is used in low level to begin with, so idk heh
f[x] has quit [Remote host closed the connection]
f[x] has joined #ocaml
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> <oleg_p>
<d_bot> <oleg_p> If we treat the operands as signed (1st bit represents their sign) then first operand's value
<d_bot> <oleg_p> is 15 and second one's is -8(2nd complement).
<d_bot> <oleg_p> 15 + (-8) = 7 , good.
<d_bot> <oleg_p> -----------------------------------------------------------------
<d_bot> <oleg_p> If we treat them as unsigned, then 1st operand is 15 and the 2nd one is 248.
<d_bot> <oleg_p> 15 + 248 = 263 and 263 > 255 but CF is 0 ... well I'm confused
<d_bot> <oleg_p> how come we don't set the CF = 1 ?
<d_bot> <oleg_p>
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
bartholin has joined #ocaml
mfp has joined #ocaml
steenuil has joined #ocaml
steenuil has quit [Read error: Connection reset by peer]
steenuil has joined #ocaml
FreeBirdLjj has joined #ocaml
gareppa has joined #ocaml
<d_bot> <joris> @undu do you know what needs to be done to support textobjects properly?
<d_bot> <undu> It got split into its own plugin: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
<d_bot> <undu> not sure about its state
<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
<d_bot> <undu> https://github.com/nvim-treesitter/playground is very useful to see the tree for the current loaded file
Anarchos has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
osa1 has quit [Ping timeout: 256 seconds]
osa1 has joined #ocaml
FreeBirdLjj has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
emias has quit [Ping timeout: 256 seconds]
<Leonidas> joris: yes, this is what I am hoping. basically paredit but for ocaml
emias has joined #ocaml
emias has quit [Client Quit]
emias has joined #ocaml
DanC has quit [Ping timeout: 260 seconds]
Haudegen has quit [Quit: Bin weg.]
DanC has joined #ocaml
Anarchos has joined #ocaml
waleee-cl has joined #ocaml
webshinra has joined #ocaml
mxns has joined #ocaml
TheLemonMan has joined #ocaml
Haudegen has joined #ocaml
oriba has joined #ocaml
shawnw has quit [Ping timeout: 264 seconds]
vicfred has joined #ocaml
raver has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
hnOsmium0001 has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
<d_bot> <ostera> are there bindings to tree-sitter for ocaml?
mxns has joined #ocaml
<d_bot> <mseri> I was thinking the same
Tuplanolla has joined #ocaml
<d_bot> <mnxn> I found https://github.com/returntocorp/ocaml-tree-sitter which seems to have OCaml bindings
bartholin has quit [Quit: Leaving]
<d_bot> <mseri> Are there ocaml implementations of lattice-based crypto algorithms?
jbrown has quit [Quit: Leaving]
Haudegen has joined #ocaml
<d_bot> <theangryepicbanana> I would probably not want to use something like tree-sitter in ocaml though
Jeanne-Kamikaze has joined #ocaml
jbrown has joined #ocaml
<d_bot> <ulrikstrid> @ostera I think the Oni team has something as well
borne has quit [Ping timeout: 260 seconds]
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
QDX45 has quit [Remote host closed the connection]
borne has joined #ocaml
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 264 seconds]
mxns has quit [Ping timeout: 260 seconds]
amiloradovsky has joined #ocaml
amiloradovsky1 has joined #ocaml
mxns has joined #ocaml
amiloradovsky has quit [Read error: Connection reset by peer]
amiloradovsky1 is now known as amiloradovsky
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
shawnw has joined #ocaml
nullcone has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
narimiran has quit [Ping timeout: 272 seconds]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
CcxWrk has quit [Quit: ZNC 1.7.4 - https://znc.in]
CcxWrk has joined #ocaml
<oni-on-ion> oni
Anarchos has joined #ocaml
CcxWrk has quit [Ping timeout: 246 seconds]
CcxWrk has joined #ocaml
CcxWrk has quit [Read error: Connection reset by peer]
CcxWrk has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Serpent7776 has quit [Quit: leaving]
borne has quit [Ping timeout: 264 seconds]
borne has joined #ocaml
Anarchos has joined #ocaml
mxns has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
neiluj has quit [Quit: Lost terminal]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
borne has quit [Ping timeout: 260 seconds]
Tuplanolla has quit [Quit: Leaving.]
mxns has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
yomimono has quit [Ping timeout: 240 seconds]
yomimono has joined #ocaml
vicfred has quit [Quit: Leaving]