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
borne has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Tuplanolla has quit [Ping timeout: 240 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ocaml
rock64 has quit [Ping timeout: 272 seconds]
rock64 has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
cohn has joined #ocaml
cohn has left #ocaml [#ocaml]
blissful has joined #ocaml
quazimodo has joined #ocaml
<quazimodo> Hello
<quazimodo> i'm having trouble understanding how to init a new project, how do you generate the packages's .opam file?
<quazimodo> when I use `opam pin .` & go through the process it doesn't actually create any .opam file
yomimono has joined #ocaml
vicfred has joined #ocaml
<quazimodo> man getting ocaml project started & compiling is like pulling teeth :/
<quazimodo> what is a 'switch configuragiot'
<d_bot> <beheddard> dune init creates an empty opam file at the least doesn't it?
<quazimodo> it's completely empty :/
<quazimodo> it put 'main.ml' in the bin/ directory :/
<quazimodo> why is everything so weird!
<d_bot> <rgrinberg> Try https://github.com/tmattio/spin
<quazimodo> `bin - Native project containing a binary.` that is such an odd choice
<quazimodo> or maybe it's not
<quazimodo> nvm i'm panicking too early
<quazimodo> he following dependencies couldn't be met: - spin -> reason -> ocaml < 4.11
<quazimodo> ocaml --version: The OCaml toplevel, version 4.11.1
<quazimodo> what does that even mean
<quazimodo> it wants to downgrade my ocaml
<companion_cube> reason is not compatible with 4.11
<companion_cube> for some reason
<quazimodo> this onboarding is difinitely a reason why ocmal isn't more popular ... my god so many ways for the damn system installation to break
<quazimodo> im a bloody tech lead i'm not a moron... this is making me feel stupid
<companion_cube> I have no idea what spin is
<dash> you lose your edge if you don't do stuff to make yourself feel stupid from time to time
<quazimodo> dash: believe me i'm no where near losing my edge... my work has me on something new damn near every day
<dash> the reasonml/ocaml/npm/dune constellation has plenty of room for confusion, being the intersection of two and a half different languages
<quazimodo> why is dune written in AST ...
<companion_cube> AST?
<quazimodo> dune appears to just be an abstract syntax tree, like a lisp
<companion_cube> https://github.com/ocaml/dune <--- dune is written mostly in OCaml
<quazimodo> well, a lisp list
<quazimodo> sorry, the dune files
<companion_cube> you mean, the dune files? S-expressions are pretty nice
<companion_cube> beats alternatives
<quazimodo> except the entire programming world just wants json :/
<quazimodo> i cut my teeth on lisp ... even I wouldn't have use sexps for what should be a json document
<quazimodo> the thinking here is so wild lol
<quazimodo> this article has been more helpful than the entire body of ocaml/opam/dune docs i've read so far
<quazimodo> what's better
<quazimodo> alcotest or rely
<d_bot> <rgrinberg> alcotest
<quazimodo> i'm accustomed to ruby's rspec style
<d_bot> <rgrinberg> As a rule of thumb, if a project is more related to reason it's much more likely to be unstable, experimental, in flux
<d_bot> <rgrinberg> So you should avoid reason related stuff until you know what you're doing
<quazimodo> is rely a reason thing?
<d_bot> <rgrinberg> Yeah
<quazimodo> ah
<quazimodo> spin appears to have done a thing, that's nice
<d_bot> <rgrinberg> Spin is a nice project from the reason world. It would be much more usable if it didn't depend on reason though
<quazimodo> yeah i'm running all this stuff in docker
<quazimodo> kinda wish we didn't use 'bin' as a directory for code & compiled executables though
<quazimodo> so weird
<quazimodo> what's this mli file
<d_bot> <rgrinberg> LIke a header file
<quazimodo> do I maintain these or are they generated ?
<d_bot> <rgrinberg> You maintain them. But they are optional. You can safely delete it
<quazimodo> is it to act as ahint to developers/compiler what the public stuff of a module should be?
<d_bot> <rgrinberg> Mainly. If there's an mli, it defines the public interface of the module
<d_bot> <rgrinberg> There are some other subtle benefits though
<companion_cube> typically that's where you put the docstrings
<quazimodo> ok
<companion_cube> (also, why would the world want json for the build? s-exprs, in this particular case, are just nicer, mostly because of comments)
<quazimodo> opam depext seems nice
<quazimodo> this thing is for build time external deps as well as runtime ones right?
<companion_cube> yes, if you depend on a C library, typically, you can install them with `opam depext`
<companion_cube> (especially in CI)
<quazimodo> fuuuucking finally it can run
blissful has left #ocaml ["The Lounge - https://thelounge.chat"]
<quazimodo> how does depext make a distinction between runtime deps & build time deps?
borne has quit [Ping timeout: 240 seconds]
<quazimodo> How to reference a function 'do_stuff' in lib/foo/bar.ml ?
<quazimodo> does directory matterS
<quazimodo> ?
<companion_cube> yep
Jesin has quit [Ping timeout: 258 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
<quazimodo> yeah i dont get it at all lol
<quazimodo> i'm struggling to reference `message = "hi"` in lib/foo/bar.ml from lib/main.ml
<quazimodo> it shouldn't be this hard!
<companion_cube> these are two separate libs, right?
<quazimodo> no i'm just trying to organise my code, why do they need to be separate libraries?
JSharp has quit [Ping timeout: 256 seconds]
<companion_cube> dune mandates that one library = one directory
<quazimodo> i am getting sad
JSharp has joined #ocaml
<companion_cube> why?
<companion_cube> in a lot of languages, layout of files matters
<quazimodo> companion_cube: apparently not ocaml
<quazimodo> can I use this with dune: https://github.com/Octachron/codept
<quazimodo> the '-nested' option is what i'm interested in
_whitelogger has joined #ocaml
narimiran has joined #ocaml
Jesin has joined #ocaml
aaaaaa has quit [Quit: leaving]
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Client Quit]
_whitelogger has joined #ocaml
osa1 has joined #ocaml
Tuplanolla has joined #ocaml
vicfred has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
snowpanda has quit [Quit: Leaving...]
snowpanda has joined #ocaml
snowpanda has quit [Quit: Leaving...]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
Haudegen has joined #ocaml
artymort has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
narimiran has joined #ocaml
artart78_ has joined #ocaml
JSharp_ has joined #ocaml
robmyers_ has joined #ocaml
artart78 has quit [Ping timeout: 240 seconds]
robmyers has quit [Ping timeout: 240 seconds]
SrPx has quit [Ping timeout: 240 seconds]
robmyers_ is now known as robmyers
JSharp has quit [Ping timeout: 240 seconds]
JSharp_ is now known as JSharp
SrPx has joined #ocaml
conjunctive has quit [Ping timeout: 240 seconds]
conjunctive has joined #ocaml
Duns_Scrotus has quit [Ping timeout: 240 seconds]
Duns_Scrotus has joined #ocaml
artart78_ is now known as artart78
artart78 has quit [Changing host]
artart78 has joined #ocaml
osa1 has joined #ocaml
narimiran has quit [Ping timeout: 265 seconds]
ggole- has joined #ocaml
zozozo_ has joined #ocaml
ggole has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 240 seconds]
zozozo has quit [Ping timeout: 240 seconds]
quazimodo has joined #ocaml
sonologico has quit [Remote host closed the connection]
_whitelogger has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
sagax has joined #ocaml
zozozo_ has quit [Quit: WeeChat 2.9]
zozozo has joined #ocaml
waleee-cl has joined #ocaml
<quazimodo> sorry for being a drama queen earlier, and probably again soon
<quazimodo> i still haven't quite figured out how (i'm using opam and dune) to have a structured lib directory. I've made a gist with a basic idea of what I mean
<quazimodo> given these files... how would I reference Controllers.Users from main.ml, for example. Would there even be a Controllers.Users or would we be doing something else
<d_bot> <craigfe> You typically need `dune` files in every directory that contains code, so you'd need one in the root and one in `controllers/`
<d_bot> <craigfe> Then `controllers/dune` defines a library with `(library ...)` that the root dune file depends on inside its corresponding `(libraries ...)` stanza
<d_bot> <craigfe> (at that point, the definitions of `controllers/users.ml` are referenced by `Controllers.Users` as you suggest)
<d_bot> <rgrinberg> Be careful of doing it this way however. You will make it very easy to introduce circular dependencies which OCaml forbids. Another option is to to use `(include_subdirs unqualified)` and forego the pretty names.
<quazimodo> im not sure how to reply to each of you separately
<quazimodo> craigfe: and what happens when you have something like Controllers.Api.V1.Users
<quazimodo> with the path being controllers/api/v1/users.ml
<quazimodo> same thing, dune will allow?
<quazimodo> rgrinberg: I'm trying to understand how do you structure a project with a team of 10 devs and many nested parts/concerns
<quazimodo> rgrinberg: do you expect everything to be super flat?
narimiran has joined #ocaml
<d_bot> <craigfe> quazimodo: The fundamental unit of shared code w.r.t. Dune is a library, which is expected to exist in a single directory. rginberg's suggestion of `(include_subdirs unqualified)` effectively causes Dune to see all files in the subtree as being part of the same directory, and so it works if all you care about is your FS structure, but does not reflect that FS structure in the namespacing of modules in the code.
<d_bot> <EduardoRFS> Not rgrinberg, but being flat is always a good idea
<d_bot> <craigfe> quazimodo: If you want to reflect arbitrary FS structure as nesting of module namespaces, you need to manually specify Dune rules that make it so. (In this case, `api/v1/dune` might define a `controllers-api.v1` library, for instance, which would then be re-exported as part of a parent library.) OCaml projects tend not to be structured this way, preferring a combination of the namespacing tools that exist in the language and mult
<d_bot> <craigfe> If you want an example of a large Dune repository, https://gitlab.com/tezos/tezos/ does this. (although it has its own idiosyncrasies)
<d_bot> <craigfe> Another example would be Dune itself.
<d_bot> <craigfe> Both of these go the route of `src/<library>/*.ml` with more granular namespacing reflected in the code rather than the file-system.
rain1 has joined #ocaml
<rain1> https://bpa.st/YUFA I got this error trying to build opam
<rain1> https://github.com/ocaml/opam#compiling-without-ocaml also make cold said cold is not a target
jnavila has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
artymort has quit [Quit: artymort]
Anarchos has joined #ocaml
vicfred has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
hnOsmium0001 has joined #ocaml
nullcone has joined #ocaml
Anarchos has joined #ocaml
TC01 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
quazimod1 has joined #ocaml
TC01 has joined #ocaml
quazimodo has quit [Ping timeout: 256 seconds]
osa1 has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
narimiran has quit [Ping timeout: 264 seconds]
ggole- has quit [Quit: Leaving]
rig0rmortis has joined #ocaml
motherfsck has quit [Quit: quit]
jnavila has quit [Quit: Konversation terminated!]
jbrown has quit [Ping timeout: 272 seconds]
pqwy[m]1 has joined #ocaml
yomimono has quit [Ping timeout: 272 seconds]
yomimono has joined #ocaml
jbrown has joined #ocaml
rig0rmortis has quit [Quit: beep boop]
oriba has joined #ocaml
Hrundi_V_Bakshi has quit [Ping timeout: 260 seconds]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
bglm[m] has joined #ocaml
rig0rmortis has joined #ocaml
TC01 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
TC01 has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
brettgilio has quit [Quit: Long live IRC! <https://brettgilio.com>]