wingsorc has quit [Remote host closed the connection]
<d_bot>
<Lewis Campbell> in practice, it means that half the time you can't call more than one method on the same struct inside the same scope. this makes your code 'safe' or something.
<d_bot>
<Serge> but ocaml keeps saying that there is no end
<d_bot>
<Serge> can some one help me
<d_bot>
<Serge> i hate programming
<d_bot>
<Serge> but my school keeps me doing programms in Ocaml and prevent me from going full on category theory mode and not touching a computer ever
<d_bot>
<NULL> Is that begin matched? I mean, maybe you need two consecutive end
<d_bot>
<Serge> but why is it reading end and sying "end expected"
<d_bot>
<Bluddy> Immutable data structures can be shared as many times as we want by different parts of the code. This isn't the case for mutable data structures: if a function passes an array to two different functions in OCaml, I can't assume both functions will receive the same data, as the first function I give it to may modify the data structure. For mutable data, any time we 'share' a data structure, only one path through the program can mod
<d_bot>
<NULL> If it needs two
<d_bot>
<Serge> does not work either 😦
<d_bot>
<NULL> Can you post the whole excerpt in a paste service or however you call them?
<d_bot>
<vinz> Can you share your code rather than the error message ?
<d_bot>
<NULL> OCaml Platform in the vscode extension list
<d_bot>
<NULL> ocamlformat in opam
<d_bot>
<Serge> ok it is already installed , now how do I install this ?
<d_bot>
<Kakadu> And probabaly you will also need empty '.ocamlformat' file in the root of the project
<d_bot>
<vinz> Everything below `let rec aux l` is a big pile of mess and ocamlformat even complains about syntax errors around `if Ast.Cnf.is_empty !p0`.
<d_bot>
<vinz> I'll add a couple of `(...)` or `begin...end` in the mix to be sure the block you consider blocks are actually considered like that by the compiler
<d_bot>
<vinz> cause alternating `let foo = ...` and `;` statements usually backfires 😄
<d_bot>
<vinz> mostly fixed by hand + ocamlformat. You have multiple syntax error (missing `;` and `)`) so ocaml has a hard time tracking your code and reports what it can
<d_bot>
<Serge> okok
<d_bot>
<vinz> woopsie, I messed up the case, let me fix this
<d_bot>
<Serge> I'll do better with ocamlformat when I will understand how to fix it
<d_bot>
<vinz> first try to refactor your code by hand, one statement per line, and you'll quickly spot the missing `;` and `)`. Even if you install ocamlformat, it won't help until the fix is syntactically correct
<d_bot>
<Serge> But can I go further using this code ?
<d_bot>
<vinz> I don't have all your libraries to make it compile, so I don't know if it is what you intended or not. I strongly advise you take some time to clean it up until it compiles
<d_bot>
<vinz> oh, there was also a `let foo = bar;` which is really bad too, `let foo = bar in ...` is the right syntax
xgqt has quit [Read error: Connection reset by peer]
<d_bot>
<NULL> let foo = bar; baz is not bad per se, it's just not binding bar to foo and still requires a closing in
xgqt has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
<d_bot>
<vinz> I'd rather say it is bad parse cause it is ugly as fuck :p
azimut has joined #ocaml
kaph has joined #ocaml
kaph_ has joined #ocaml
kaph has quit [Ping timeout: 248 seconds]
<d_bot>
<tourist> Is it possible to use ocaml to make small games
waleee has joined #ocaml
<d_bot>
<VPhantom> I can't think of something you _couldn't_ do with OCaml; it's a general-purpose language.
<d_bot>
<octachron> It is possible. It can be a fun project. But you will probably spent a lot of time implementing your game pipeline and engine rather than designing the game.
<companion_cube>
there are bindings to existing engines, but it's unclear how mature they are
<gravicappa>
There is a [binding](https://github.com/tjammer/raylib-ocaml) for [raylib](raylib.com) library. It has some quircks but generally works. Also making small games in raylib is relatively easy.
<companion_cube>
also, SDL bindings exist
rawley has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]
<d_bot>
<vinz> He wrote `marlin` instead of `merlin` 😄
<d_bot>
<mbacarella> Nice writeup.
<d_bot>
<mbacarella> That sounds... useful? Is there a way of doing this in OCaml?
<d_bot>
<Bluddy> not without the typechecker supporting linear types
<d_bot>
<Bluddy> but the first versions of rust were written in ocaml 🙂
<d_bot>
<Bluddy> the downside is that you have to manage the types, which means you always have to consider which part of the code takes ownership of data.
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
olle has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
<d_bot>
<Patate> I'm writing bindings for the Vulkan library. Was lazy writing C/C++ again.
rawley has quit [Ping timeout: 246 seconds]
<d_bot>
<Patate> I like the explicitness of it. No openGL magic.
<d_bot>
<Patate> What type of games do you want to do?
vicfred has quit [Quit: Leaving]
<d_bot>
<Bluddy> I'm rewriting a reverse-engineered game if you're interested in seeing how I do it.
kaph has quit [Read error: Connection reset by peer]
kaph_ has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
kaph has quit [Ping timeout: 250 seconds]
dextaa has quit [Ping timeout: 272 seconds]
<d_bot>
<atlx> Is state actions used in ocaml?
<d_bot>
<atlx> Im having a hard time thinking of how to properly implement stuff in ocaml.
<d_bot>
<atlx> As in, what functional programming things are preferred, used in ocaml
<d_bot>
<atlx> For example, how would one model/design a parser? My current implementation is just pattern match then call corresponding sub parser, and bubble up error if encountered
<d_bot>
<atlx> Surely there must be better ways
<d_bot>
<octachron> You can use either a parser generator like menhir or a parser combinator library rather than writing your own recursive descent parser.
vicfred has quit [Quit: Leaving]
mbuf has quit [Quit: Leaving]
<d_bot>
<atlx> In terms of writing my own parser tho
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vicfred has joined #ocaml
<d_bot>
<atlx> I like doing my own things, to learn
<d_bot>
<atlx> The question is, is there a better way to model something like a recursive descent parser in ocaml?
<d_bot>
<atlx> Another example would be my lexer, I currently have to pass around its state (position) after every lex call, which is repetitive. And I know that repetition can be abstracted, but not sure exactly how. This applies to my parser impl as well, it passes around the tail of the list after it has consumed tokens..
<d_bot>
<atlx> Would something like state actions be a good solution for this cases?
kaph has joined #ocaml
gravicappa has quit [Ping timeout: 272 seconds]
<olle>
21:27 < blueagain> fast and simple I like, but fully typed is a deal breaker
<olle>
Different perspective here :D
rawley has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
<d_bot>
<Halp> @everyone is someone good with OCaml that wanna help with an assigment, DM please 🙏🏼 ❤️
<olle>
Don't ask to ask, just ask
<olle>
No DM
<d_bot>
<NULL> As stated in #beginners, we don't do homework, we answer questions
<d_bot>
<glennsl> Also don't try to ping everyone. Your problem is not that important to anyone other than yourself.
<d_bot>
<Halp> oh I didnt see, sorry
kaph has quit [Ping timeout: 256 seconds]
bartholin has quit [Quit: Leaving]
rawley has quit [Remote host closed the connection]
kaph has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
Techcable has quit [Remote host closed the connection]
Techcable has joined #ocaml
wingsorc has joined #ocaml
<d_bot>
<Lewis Campbell> FWIW, I hated a lot of stuff at first exposure to university that I now find really interesting 10 years later. Not saying programming will be one of them for you, but keep an open mind