tryte has quit [Remote host closed the connection]
tryte_ has joined #ocaml
nullcone has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
borne has quit [Ping timeout: 244 seconds]
borne has joined #ocaml
mxns has joined #ocaml
<d_bot>
<poogle> I've installed ocaml-lsp-server via opam but ocaml-platform in vscode failing with 'Command ocamllsp not found.' `which ocamllsp` from my shell is showing that it is in my .opam dir. So what could be the issue here?
dhil has quit [Ping timeout: 246 seconds]
<d_bot>
<poogle> @theangryepicbanana still around?
<d_bot>
<rgrinberg> @poogle did you select the opam switch that contains ocamllsp from within vscode?
<d_bot>
<rgrinberg> There's a command for that
<d_bot>
<poogle> @rgrinberg no. but fwiw, i only have one switch atm. i will look into it though
<d_bot>
<poogle> @rgrinberg would this be under 'Ocaml configuration' in vscode?
<d_bot>
<theangryepicbanana> probably
<d_bot>
<rgrinberg> There's a command to launch to it. You can do `Cmd + P` and search for OCaml. Alternatively, you can click the status bar item where lsp writes its excerpt.
<d_bot>
<poogle> command 'ocaml.switch-impl-intf' not found
<d_bot>
<poogle> looks like none of the ocaml related commands are being found
<d_bot>
<poogle> same for 'ocaml restart language server'
opweiqw has quit [Remote host closed the connection]
<d_bot>
<rgrinberg> Hmm, that's weird. I think you need to open an issue on the bug tracker with some details + screenshots
<d_bot>
<poogle> @rgrinberg @theangryepicbanana what dictates how vscode finds commands?
<d_bot>
<rgrinberg> If the extension is installed, the commands should be registered.
<d_bot>
<poogle> is there a list of registered commands?
<d_bot>
<rgrinberg> It should be in the package.json for the plugin
<d_bot>
<poogle> ok.
<d_bot>
<poogle> maybe ill have better luck with the reason ext
<d_bot>
<rgrinberg> good luck
garfr has joined #ocaml
ygrek has joined #ocaml
<garfr>
Generally when I am using a symbol table in an imperative language, I have AST nodes that refer to the symbol table hold pointers to the entries. Is there a way to do something like this in OCaml? It seems like its in opposition to a functional paradigm, so is there a better way to structure systems like this?
<d_bot>
<poogle> @rgrinberg what is your dev environment like? i'm flexible. just trying to find something that makes it a little easier to learn ocaml. my main difficulty is remembering/knowing where to look for various functions. so basically anything with code completion would work for me
<companion_cube>
garfr: no need to be purely functional
<companion_cube>
Pointers and hash tables are fair game
mxns_ has joined #ocaml
<garfr>
companion_cube: I am already using hash tables, but how would I take a pointer to an entry to the builtin Hashtbl type?
mxns has quit [Ping timeout: 260 seconds]
<companion_cube>
hum, the entries are private
<companion_cube>
why do you want to do that?
<garfr>
The alternative is to have the AST carry around the variable name and rehashing it to find the information each time, instead of simply holding a pointer to the table.
<garfr>
At least I think so, I am new to all this any way.
mxns_ has quit [Ping timeout: 260 seconds]
<companion_cube>
you can use a record for representing variables?
<companion_cube>
`type var = { name: string; info: …}`
<companion_cube>
and have the hashtable map strings to vars
<garfr>
Thats what I am currently doing, but I have to search the table with teh string every time to get access to the variable info
<companion_cube>
well, in the AST you can use `var`, instead of `string`
<companion_cube>
map the string to the `var` record at scoping time
<garfr>
What do you mean? The hashtable already maps string to the 'var' record, and if I can keep a pointer to a symbol table for all the uses of a variable I only have to hash it in once per use.
<companion_cube>
I mean, yes
<companion_cube>
personally I use these hashtables only during scoping
<companion_cube>
then you can throw them away
<garfr>
Do you just give them unique names?
<garfr>
And how do you manage register allocation without a symbol table?
<companion_cube>
hum, I don't write compilers, more like logic tools
<companion_cube>
but I'd say register allocation comes much much later?
<companion_cube>
probably you'd have an SSA representation?
mxns has joined #ocaml
<garfr>
Hmm, I want to keep it as a AST for a bit for some optimization and type inference stuff. Converting to a 3 address code style format is certainly a goal, but it might come later. For now I will just hash the variable name in everytime and if it becomes a real performance bottleneck I will get back to the problem.
<companion_cube>
anyway, you may want to look at ocamlc's own code
<companion_cube>
variables are Ident.t for a good while, which is a (qualified) name + unique integer
ygrek has quit [Remote host closed the connection]
<companion_cube>
the integer makes shadowing easy
ygrek has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
garfr has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 272 seconds]
mxns has quit [Ping timeout: 244 seconds]
mfp has quit [Ping timeout: 264 seconds]
vicfred has joined #ocaml
steenuil has quit [Read error: Connection reset by peer]
steenuil has joined #ocaml
<d_bot>
<ggole> If you are using `var`s rather than strings then you would have a pass that transforms the AST from one containing `string` names to one containing `var`s, and you do the string lookup in that pass (that is, once).
<d_bot>
<ggole> When you need to store info about the variable, for register allocation or whatever other purpose, you can either stash it in the `var` itself or use a mapping from `var` to the info.
Jeanne-Kamikaze has quit [Quit: Leaving]
tryte_ has quit [Ping timeout: 240 seconds]
tryte has joined #ocaml
urek has joined #ocaml
mxns has joined #ocaml
oni-on-ion has joined #ocaml
urek__ has quit [Ping timeout: 272 seconds]
vicfred has quit [Quit: Leaving]
borne has quit [Ping timeout: 260 seconds]
narimiran has joined #ocaml
<d_bot>
<inkbottle> Ive added the following `package.json` file in a "cloned opium" (I mean verbatim):
<d_bot>
<inkbottle> The project is correctly built.
<d_bot>
<inkbottle>
<d_bot>
<inkbottle> With the file however, I've got errors stating that the dependencies specified in the generated `{opium,rock}.opam` files are not met. So, even though the opam files have been generated, they are not used the way they are when without the `package.json` file.
<d_bot>
<inkbottle>
<d_bot>
<inkbottle> I want to use this additional `package.json` file, because I want to tweak the specifications provided by `dune-package`.
<d_bot>
<inkbottle>
<d_bot>
<inkbottle> However, I do not want to "repeat" those specifications.
<d_bot>
<Anurag> @inkbottle To override items from the project's existing setup you'd probably need esy's support for sandbox-config overrides
<d_bot>
<Anurag> I don't know how well it works with multiple opam files at once though
<d_bot>
<Anurag> I haven't used `esy` in a while so I don't know the current state of its support for projects with multiple packages in the source tree
<d_bot>
<inkbottle> Yes, I've read about that, but I've difficulties to figure out how it works: For what I understand I could start installing the project w/o additional `package.opam`, which would work, and then, start doing some overrides. But my understanding of the many points is so low, that the trial and error process could last forever.
<d_bot>
<inkbottle> I still believe it is possible to have a `package.json` file stating that information should be taken from `dune-project`.
<d_bot>
<inkbottle> That is my best bet for the present that it is the way to do it ("This is the way.").
<d_bot>
<Anurag> your best bet would be to open issues on esy's repo of ask on the forum at https://discuss.ocaml.org/
<d_bot>
<Anurag> In addition, if you don't have a strong reason for esy, maybe use `opam` in the meantime? It works well for the usecase you describe.
<d_bot>
<Anurag> most github repos i've seen where people use `esy` for regular ocaml projects, they end up duplicating the dependencies in both the opam file and the package.json
<d_bot>
<inkbottle> Duplicating dependencies seems like very bad practice.
<d_bot>
<inkbottle> I've come to esy because it allows replacing opam dependency with github version of it.
<d_bot>
<inkbottle> And there are other things that seem convenient too.
<d_bot>
<inkbottle> And if you start from a dune project, everything work out of the box.
<d_bot>
<inkbottle> Only thing here, I want to tweak it. I'll figure it out, or I will open an issue, stating just the lengthy specifics of my question.
urek has quit [Ping timeout: 260 seconds]
<d_bot>
<inkbottle> I think I have s simple an universal instance of the question:
<d_bot>
<inkbottle> And then, on top of it, you additionally want `utop` in the same sandbox.
<d_bot>
<inkbottle> And you'd prefer to have it through the addition of a `.json` file, that expresses: "Just do the things that are specified in the `dune-project` file. And when you're done, add `utop` or `ocaml-lsp-server` to the mix."
<d_bot>
<inkbottle> And also, since the `.opam` files are generated from the `dune-project` file, how can I do without, the `.opam` files, from the very start of the process? (Try to remove them and see if you can install anything at all.)
<d_bot>
<inkbottle> "Almost every esy command operates in context of a project sandbox which is defined by a sandbox manifest (usually `package.json` but `esy.json` is also supported)." in https://esy.sh/docs/en/how-it-works.html. But in the case described above there is no manifest (in the form of a `package.json` file). Which for instance is required if you want to override it. Quite a conundrum.
shawnw has quit [Ping timeout: 264 seconds]
ygrek has quit [Remote host closed the connection]
shawnw has joined #ocaml
shawnw has quit [Remote host closed the connection]
shawnw has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
aaaaaa has quit [Ping timeout: 260 seconds]
aaaaaa has joined #ocaml
h11 has quit [Quit: Idle for 30+ days]
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
dhil has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
bartholin has joined #ocaml
Anarchos has joined #ocaml
<Anarchos>
dune 2.7 with ocaml 4.11.1 is really faster to compile than dune 2.2 with ocaml 4.08 !!
Tuplanolla has joined #ocaml
jnavila has joined #ocaml
gareppa has joined #ocaml
tryte has quit [Remote host closed the connection]
tryte has joined #ocaml
gareppa has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 260 seconds]
shawnw has quit [Remote host closed the connection]
mxns has joined #ocaml
tryte has quit [Remote host closed the connection]
shawnw has joined #ocaml
tryte has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
BitPuffin has quit [Ping timeout: 240 seconds]
labor[m] has quit [Ping timeout: 246 seconds]
flux has quit [Ping timeout: 246 seconds]
peddie has quit [Ping timeout: 260 seconds]
aspiwack[m] has quit [Ping timeout: 268 seconds]
pqwy[m] has quit [Ping timeout: 240 seconds]
loxs[m] has quit [Ping timeout: 244 seconds]
Manis[m] has quit [Ping timeout: 244 seconds]
kanishkaa[m] has quit [Ping timeout: 244 seconds]
camlriot42 has quit [Ping timeout: 244 seconds]
jayesh-bhoot has quit [Ping timeout: 244 seconds]
mmohammadi9812 has quit [Ping timeout: 244 seconds]
bartholin has quit [Ping timeout: 260 seconds]
lnxw37d4 has quit [Ping timeout: 246 seconds]
jimt[m] has quit [Ping timeout: 260 seconds]
dash has quit [Ping timeout: 268 seconds]
aterius has quit [Ping timeout: 268 seconds]
stan[m] has quit [Ping timeout: 268 seconds]
ptival[m] has quit [Ping timeout: 246 seconds]
<Anarchos>
how to debug a project with dune ?
urek has joined #ocaml
bartholin has joined #ocaml
mxns has joined #ocaml
flux has joined #ocaml
labor[m] has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
bartholin has quit [Ping timeout: 265 seconds]
BitPuffin has joined #ocaml
kanishkaa[m] has joined #ocaml
mmohammadi9812 has joined #ocaml
mfp has joined #ocaml
ptival[m] has joined #ocaml
pqwy[m] has joined #ocaml
borne has joined #ocaml
aspiwack[m] has joined #ocaml
jayesh-bhoot has joined #ocaml
camlriot42 has joined #ocaml
loxs[m] has joined #ocaml
aterius has joined #ocaml
lnxw37d4 has joined #ocaml
Manis[m] has joined #ocaml
bartholin has joined #ocaml
stan[m] has joined #ocaml
peddie has joined #ocaml
dash has joined #ocaml
jimt[m] has joined #ocaml
Haudegen has joined #ocaml
mxns has joined #ocaml
borne has quit [Ping timeout: 244 seconds]
mxns has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
infinity0 has joined #ocaml
aaaaaa has quit [Quit: leaving]
nullcone has quit [Quit: Connection closed for inactivity]
neiluj has joined #ocaml
neiluj has joined #ocaml
narimiran has quit [Ping timeout: 272 seconds]
narimiran has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
sagax has quit [Remote host closed the connection]
Haudegen has joined #ocaml
shawnw has quit [Remote host closed the connection]
shawnw__ has joined #ocaml
bartholin has joined #ocaml
shawnw__ is now known as shawnw
<d_bot>
<Aram> I have read the original papers/documents describing effect handlers in OCaml. Back that, effect handlers were dynamically typed. I have read more recently that this idea was abandoned and the new effect handlers will be statically typed. Is there any kind of document describing this?
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
dhil has quit [Ping timeout: 256 seconds]
urek has quit [Read error: Connection reset by peer]
urek has joined #ocaml
sagax has joined #ocaml
nkatte has joined #ocaml
vesper11 has quit [Ping timeout: 240 seconds]
bartholin has quit [Ping timeout: 265 seconds]
vesper11 has joined #ocaml
raver has joined #ocaml
Anarchos has joined #ocaml
bartholin has joined #ocaml
dhil has joined #ocaml
<Anarchos>
try h x with e -> (Printexc.print_backtrace stdout;flush stdout;1) doesn't print any backtrace
shawnw has quit [Ping timeout: 256 seconds]
<zozozo>
Anarchos: does h raise an exception ?
<zozozo>
ah, also, you need backtraces to be enabled, that means building your project with the "-g" option (which is used by default by dune)
<zozozo>
you can check whetehr backtraces are enabled using Printexc.backtrace_status and Printexc.record_backtrace
<Anarchos>
zozozo i compile iwth dune
<Anarchos>
zozozo ok, in toplevel with record_backtrace, it works
madroach has joined #ocaml
<Anarchos>
zozozo with dune too, i had to call record_backtrace (even if i compile with dune)
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
<zozozo>
Anarchos: yes, you either have to call record_backtrace, or have "b" in OCAMLRUNPARAM when running the program
<Anarchos>
zozozo but i compile with dune...
<zozozo>
you nedd both: the "-g" option when compiling so that the compiler inserts the correct code when raising to make it able to record the backtrace, *and* the runtime indication to actually record them
<Anarchos>
zozozo ok ok
ygrek has joined #ocaml
garfr has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
bartholin has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mcginleyr1 has quit [Quit: Connection closed for inactivity]
urek has quit [Ping timeout: 272 seconds]
mxns has quit [Ping timeout: 260 seconds]
bartholin has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
ygrek has quit [Remote host closed the connection]
<Anarchos>
in ocamldebug, how to skip the loading of stdlib to go straight to the loading of the module i want to debug ?
vicfred has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
narimiran has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
<d_bot>
<EduardoRFS> add a breakpoint
<d_bot>
<EduardoRFS> does someone know a way to debug the vscode-ocaml-platform extension? ocamllsp is crashing but it doesn't say way
bartholin has quit [Ping timeout: 256 seconds]
<d_bot>
<poogle> @EduardoRFS my attempt to get it working kept failing because it could not find any of the ocaml-platform commands. did you have that issue at all?
<d_bot>
<EduardoRFS> It's not that for me, if it cannot find the ocaml-platform commands is probably your esy / opam local switch not configured or ocaml-lsp-server not installed
<d_bot>
<EduardoRFS> but I found it `"ocaml.trace.server": "messages"`
<d_bot>
<poogle> what do you mean by 'opam local switch not configured'? i only have one switch at the moment and `opam list` shows that ocaml-lsp-server is installed. also, `which ocamllsp` shows that it is in my .opam dir
<d_bot>
<EduardoRFS> @poogle did you select it in the list?
<d_bot>
<poogle> @EduardoRFS which list?
<d_bot>
<EduardoRFS> the list of opam switches on the extension
<d_bot>
<Ulugbek> you probably have this button in the extension;
<d_bot>
<Ulugbek> if you click on it, you get a list of opam and esy sandboxes
<d_bot>
<poogle> clicking it fails with 'command `ocaml.select-sandbox`' not found
bartholin has joined #ocaml
<d_bot>
<poogle> i see a sandbox setting in the extensions settings. but had not seen it mentioned in the various install tutorials ive read
<d_bot>
<poogle> so it's necessary to define a sandbox?
<d_bot>
<Ulugbek> > I'm not familiar with using ocaml-lsp with wsl debian, but based on the errors you mention, it seems they come from the OCaml Platform vscode extension rather than ocaml-lsp (or absence of ocaml-lsp corrupts the extension's state, which is also a possibility).
<d_bot>
<Ulugbek> >
<d_bot>
<Ulugbek> > Could you give us versions of the extension and ocaml-lsp that you have installed, the exact error messages you see and what's shown in "output" pane of vscode for "OCaml Platform" and "ocaml language server"? (you can create an issue [here](https://github.com/ocamllabs/vscode-ocaml-platform/issues)
<d_bot>
<Ulugbek> >
<d_bot>
<Ulugbek> > A quick fix can be just to launch vscode from the command line from the root of your project, but again I'm not very familiar with wsl.
<d_bot>
<Ulugbek> This answer to a post may help ^
Jeanne-Kamikaze has quit [Ping timeout: 240 seconds]
<d_bot>
<poogle> ok
<d_bot>
<rgrinberg> I don't think it has much to do with opam switches or esy. The commands are defined entirely within the extension. My suspicion is that it's a bug in the plugin or some sort of borked installation.
<d_bot>
<EduardoRFS> oh, mb is by far the biggest problem
<d_bot>
<poogle> what info/screenshots should i include in a post about this issue?
<d_bot>
<poogle> versions of ocaml, opam, ocaml-lsp-server and vscode, a screenshot of the vscode missing command msg. anything else?
<d_bot>
<rgrinberg> You only need a version of the plugin + the screen shot.
<d_bot>
<rgrinberg> The versions of ocaml, opam, and ocaml-lsp-server do not matter.
<d_bot>
<poogle> and post it to the extensions github issues page/
<d_bot>
<poogle> log.ts:197 ERR No application in the Launch Services database matches the input criteria.: Error: No application in the Launch Services database matches the input criteria.
<d_bot>
<rgrinberg> try restarting vscode and then seeing the log again
<d_bot>
<rgrinberg> Also, what other extensions do you have installed?
<d_bot>
<poogle> vscode-elixir is the only other extension currently installed
<d_bot>
<poogle> think it would help if i uninstalled it?
<d_bot>
<rgrinberg> It's worth trying.
<d_bot>
<rgrinberg> Wait, I mean reinstalling the ocaml extension
<d_bot>
<rgrinberg> uninstalling the elixir extension doesn't seem useful
<d_bot>
<poogle> Boom!
<d_bot>
<poogle> looks like a restart did the job!
<d_bot>
<poogle> fwiw, i've uninstalled and installed the extension several times in the past. but this is the first time i've done a full 'quit'
<d_bot>
<poogle> so when is a restart necessary?
<d_bot>
<rgrinberg> Never. I think we have crappy code that needs fixing
<d_bot>
<rgrinberg> I'm taking a look
nullcone has joined #ocaml
<d_bot>
<poogle> well that was a pretty demoralizing experience for a bit there..."i can't even get an extension working that is supposed to be a breeze to install...maybe ocaml isn't for me"
<d_bot>
<poogle> back to loving ocaml again though.
<d_bot>
<poogle> thanks for the help!
<d_bot>
<rgrinberg> Nah, thanks for sticking with it. I think I know what the bug is btw. So we should fix it shortly.
<d_bot>
<poogle> I'm interested in know what caused this and how it's fixed. How can I best track this. Will there be a listing in the issues page on github?
<d_bot>
<poogle> Or just watch the pull requests?
<d_bot>
<rgrinberg> I'll cc you
<d_bot>
<poogle> awesome
<d_bot>
<mnxn> I'm not sure if this is the same bug, but if I manually edit the `setting.json` to this, I get the same error messages.
<d_bot>
<mnxn> Yeah looks like if the sandbox setup fails it doesn't create an instance, but does create the statusbar item, which is misleading since clicking on it won't do anything.
<d_bot>
<rgrinberg> Yup
<d_bot>
<Cyclomatic Complexity> ~~I am getting `command ocamllsp not found` in VsCode~~
<d_bot>
<Cyclomatic Complexity> Currently reinstalling the extension
<d_bot>
<rgrinberg> Don't bother reinstalling. That's not the issue. We'll push an update today