Haudegen has quit [Remote host closed the connection]
JimmyRcom_ has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ocaml
spew has joined #ocaml
VermillionAzure has quit [Ping timeout: 268 seconds]
malina has quit [Ping timeout: 256 seconds]
spew has quit [Remote host closed the connection]
spew has joined #ocaml
hlysig has quit [Ping timeout: 264 seconds]
dedgrant_ has quit [Quit: Leaving]
shinnya has joined #ocaml
spew has quit [Ping timeout: 265 seconds]
<Ankhers>
I am going through the beta of Real World OCaml. It just had me create my first program, and I am to use jbuilder to build the executable. Unfortunately it does not tell me how to do that. I tried running `jbuilder build` which creates a _build directory for me, but I don't seem to have any executables in there, nor is there any output. Am I supposed to use a different command?
FreeBirdLjj has joined #ocaml
ziyourenxiang has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
zolk3ri has quit [Remote host closed the connection]
<mrvn>
jbuilder for your first programm? Seems like overkill.
<mrvn>
Doesn't it tell you to simply type the programm into the top-level or the command to compile it?
jao has quit [Ping timeout: 264 seconds]
hdon has quit [Ping timeout: 260 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
mfp has quit [Ping timeout: 245 seconds]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 240 seconds]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 256 seconds]
pierpa has quit [Quit: Page closed]
pierpal has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
<discord3>
<mars0i> @Ankhers if the source file for your executable is foo/bar, the executables should be in _build/default/foot/bar. Or look under _build/install/.... At least that's where they are on my system. There's also a way to run the executable with jbuilder run, but you have to give it the correct path, and I forget the rule for that.
<discord3>
<mars0i> if the source file for the executable is baz.ml, the executable will probably be called baz.exe (native binary) or baz.bc (bytecode).
<discord3>
<mars0i> All of this depends on the jbuild file, so if what's in there isn't right, you might not have an executable or maybe it could have a different name.
pierpal has quit [Read error: Connection reset by peer]
<discord3>
<mars0i> You need an executables sexp, i.e. (executables ...), and within that names and maybe public_names, and definitely (modes (native)) or (modes (byte)). I don't entirely know what I'm doing with the jbuild file. Others will know more, but there often aren't many people paying attention this time of day.
<discord3>
<mars0i> (@mrvn My preference is to start with a good jbuild template. When I'm starting out, I don't want to remember what gets what command line option. I want a good build system to do it for me. Actually, I still want that. My first move when I started learning OCaml was to figure out how to set up an Oasis config; jbuilder wasn't popular yet. Some languages have a simple utility that gives you a working config
<discord3>
and build script with one command at the shell prompt. Then you can focus on learning the language, and figure out what's going on during building later.)
<discord3>
<bobby> I agree with mars0i, setting up jbuild is quite straightforward even for a first program, and saves you from remembering incantations
<Ankhers>
mrvn: It does not tell you the command. I'm guessing this part of the book isn't quite complete (https://dev.realworldocaml.org/guided-tour.html -- scroll to "A Complete Program")
<Ankhers>
@mars0i: Yeah, they mention that in the book, but I don't seem to have any directories in _build. Just a couple files.
pierpal has joined #ocaml
gonz_ has quit [Ping timeout: 260 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 265 seconds]
<discord3>
<mars0i> @Ankhers, bobby's blog post is very good. The jbuilder/dune docs don't have a good starting tutorial like his.
<discord3>
<mars0i> My guess is that RWO 2 will eventually include a specification of a basic jbuild file. They weren't using jbuilder in RWO 1, so all of the jbuilder material is new.
_whitelogger has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
tane_ has joined #ocaml
FreeBirdLjj has joined #ocaml
hdon has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<discord3>
<bobby> Ankhers, indeed that part of the book seems incomplete
<discord3>
<bobby> given that you have a sum.ml and jbuild in the directory, and both base and stdio installed (opam install base stdio), you can invoke jbuilder build sum.exe, and the executable will be at _build/default/sum.exe
hdon has quit [Ping timeout: 256 seconds]
dtornabene has joined #ocaml
freyr has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
sz0 has joined #ocaml
Soni has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
Haudegen has joined #ocaml
hlysig has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Client Quit]
mk9 has joined #ocaml
Madars has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
mk9 has quit [Client Quit]
hlysig has quit [Ping timeout: 264 seconds]
hdon has joined #ocaml
Madars has joined #ocaml
hdon has quit [Ping timeout: 260 seconds]
Bronsa has joined #ocaml
malina has joined #ocaml
Madars has quit [Ping timeout: 264 seconds]
hdon has joined #ocaml
mfp has joined #ocaml
dtornabene has quit [Ping timeout: 264 seconds]
philtor has quit [Ping timeout: 260 seconds]
zolk3ri has joined #ocaml
hdon has quit [Ping timeout: 264 seconds]
hlysig has joined #ocaml
kakadu has joined #ocaml
hlysig has quit [Ping timeout: 268 seconds]
hlysig has joined #ocaml
tg has quit [Excess Flood]
jao has joined #ocaml
Madars has joined #ocaml
tg has joined #ocaml
hlysig has quit [Ping timeout: 248 seconds]
pierpal has quit [Quit: Poof]
exarkun has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
exarkun has joined #ocaml
malina has quit [Ping timeout: 276 seconds]
Madars has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 248 seconds]
argent_smith has joined #ocaml
Madars has joined #ocaml
malina has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
hlysig has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
dhil_ has joined #ocaml
zolk3ri has quit [Ping timeout: 264 seconds]
Madars has quit [Ping timeout: 276 seconds]
philtor has joined #ocaml
zolk3ri has joined #ocaml
argent_smith1 has joined #ocaml
Bronsa has quit [Remote host closed the connection]
argent_smith has quit [Ping timeout: 256 seconds]
<Ankhers>
@bobby: That did it, thank you!
<discord3>
<bobby> Glad you got it working!
<Ankhers>
Is it possible to use jbuilder to build the executable without the .exe? It is a little strange to have that extension in a non-windows environment?
<discord3>
<bobby> For the build command, you would need to have a <project>.opam file in the directory, and it would work with jbuilder build
<discord3>
<bobby> But for the executable, it is a convention in jbuilder to use .exe for native executables afaik
<Ankhers>
Gotcha. Thank you very much!
shinnya has joined #ocaml
hdon has joined #ocaml
<discord3>
<bobby> But you can rename and move the resulting executable any way you like
hdon has quit [Ping timeout: 264 seconds]
silver has joined #ocaml
hlysig has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
hlysig has joined #ocaml
FreeBirdLjj has joined #ocaml
jao has quit [Ping timeout: 248 seconds]
Madars has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
malina has quit [Ping timeout: 248 seconds]
argent_smith has joined #ocaml
argent_smith1 has quit [Ping timeout: 265 seconds]
neatonk has joined #ocaml
Madars has quit [Ping timeout: 256 seconds]
neatonk has quit [Ping timeout: 265 seconds]
argent_smith1 has joined #ocaml
argent_smith has quit [Ping timeout: 260 seconds]
BitPuffin has joined #ocaml
argent_smith has joined #ocaml
argent_smith1 has quit [Ping timeout: 248 seconds]
tane_ has quit [Quit: Leaving]
freyr has quit [Remote host closed the connection]
argent_smith has quit [Ping timeout: 276 seconds]
<discord3>
<Perry> Is there a way to get jbuilder to build my .merlin file for me etc?
Madars has joined #ocaml
argent_smith has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
argent_smith1 has joined #ocaml
argent_smith has quit [Ping timeout: 268 seconds]
hlysig has quit [Ping timeout: 264 seconds]
<discord3>
<bobby> @Perry it should build .merlin files by default, is it not the case?
<discord3>
<bobby> the generated .merlin files would be in each directory where jbuild is present
tane has joined #ocaml
bobby_ has joined #ocaml
hlysig has joined #ocaml
bobby_ has quit [Ping timeout: 260 seconds]
hlysig has quit [Ping timeout: 264 seconds]
malina has joined #ocaml
dhil_ has quit [Ping timeout: 256 seconds]
<discord3>
<Perry> Ah, my deep ignorance of dune/jbuilder is showing.
<discord3>
<Perry> @bobby you have an intro to using dune somewhere, right? where can I find it?