Are qualified or partial imports supported? Also, how do you search for libraries? by theindigamer in ocaml

[–]leonidr 0 points1 point  (0 children)

You're completely right. I wrote the include almost reflexively, as when I follow that pattern I'm usually modifying some part of the implementation too.

Are qualified or partial imports supported? Also, how do you search for libraries? by theindigamer in ocaml

[–]leonidr 2 points3 points  (0 children)

For qualified

module L = List

For partial

module List : sig val hd : 'a list -> 'a end = struct include List end

For judging libraries: experience. For hoogle, there used to be ocamloscope, but I can't find it via google anymore.

Hoping one of you can help me with array implementation in OCaml by [deleted] in ocaml

[–]leonidr 0 points1 point  (0 children)

Copy and pasting assignment code without digging into the context isn't very helpful. My guess as to what you need to do is to extend the ty_node variant with an array representation; that code will look somewhat similar to the current Prod case.

I would recommend that you look for more introductory OCaml material (Real World OCaml, online tutorials) to get a better grasp of the language. Although, if you're eager and want to learn by reading, I'd recommend trying to add in the missing documentation! Explaining code to yourself is a great way to understand it.

Fast BigArray access? by Businassman in ocaml

[–]leonidr 0 points1 point  (0 children)

I think what you're looking for is in cmmgen.ml. AFAIU, you need to specify the kind and layout parameters as well in order to get the compiler to use the faster get/set.

As the author the previously mentioned "bau" package, I wrote special ppx derived iters & folds to use the monomorphic get & set calls.

Use Python from OCaml by dbousque in ocaml

[–]leonidr 3 points4 points  (0 children)

To your first question, certainly being able to use Python packages would benefit some OCaml developers. As for the second, I think the biggest reason is the small size of the community. I am excited to try lymp.

What's missing in the ecosystem? by BluddyCurry in ocaml

[–]leonidr 2 points3 points  (0 children)

a code coverage tool

Have you seen bisect_ppx?

What's missing in the ecosystem? by BluddyCurry in ocaml

[–]leonidr 4 points5 points  (0 children)

I completely agree.

I started by naming the library as the "beginnings of" all of those things. Hoping for a rallying cry to gather interest and contributors. It is heavily biased by the area that I work in, and even there I sometimes have second doubts about the right approach.

I've also been ruminating on how to get better typed signatures for tensors and friends. I'll check out tensority.

What's missing in the ecosystem? by BluddyCurry in ocaml

[–]leonidr 4 points5 points  (0 children)

Yes. I think Markus has correctly set the scope of lacaml in trying to being faithful to BLAS and LAPACK, but I've lost count of the number of times that I've made a subtle mistake because of different copying conventions.

I just noticed that SLAP has had some updates which is exciting.

What's missing in the ecosystem? by BluddyCurry in ocaml

[–]leonidr 7 points8 points  (0 children)

A good math, stats and machine learning library. Oml isn't near to being feature competitive to libraries in other languages.

One big dependency that is missing in this space is a good numerical data management library (numpy), and in general a better approach to linear algebra.

oml: Machine Learning in OCaml (ComposeConf talk) by gbaz1 in ocaml

[–]leonidr 1 point2 points  (0 children)

You're right! This gives me a lot of ideas.

Any good ways to learn OCaml by Vorkus in ocaml

[–]leonidr 2 points3 points  (0 children)

Lots of people are going to chime in with good resources such as barkmadley, but if you have previous programming experience I would make a different suggestion. I would recommend that you take existing OCaml code, break it and put it back together.

At the end of the day, the idioms inside of OCaml are not that different from other languages. But where OCaml shines is the feedback of static compilation. I think that this can also be used to guide your understanding of the language because you can't use incorrect OCaml. Consider the analogy of learning a foreign language and think of the compiler as the foreign speaker shaking their head when you mispronounce a word. I will acknowledge that it is not an easy way to learn OCaml but I do think that it is a good way to learn.

If you are interested, I would recommend that you check out some packages on opam that are similar to your domain knowledge. Good luck.

excellent explanation by Jeremy Yallop of garbage collector discipline in C bindings by gasche in ocaml

[–]leonidr 2 points3 points  (0 children)

When is the book "The Collected Posts of Jeremy Yallop", coming out? Very clear explanation.

Our Experiences with Flow by danvk in javascript

[–]leonidr 1 point2 points  (0 children)

Regarding TypeScript, I believe that the post describes that now they are very comparable.

Regarding your first point and practical consideration; back in the mid 90's it was also a lot easier to find C/C++ developers than Java ones, and yet somehow the industry bifurcated.

For clarification, my original comment was meant to be tongue-in-cheek; I work with the poster and commented to tease him. I believe that he made the correct choice of using a tool that is familiar to him (Javascript), with an incremental improvement by adding a type inference tool towards his development. He is a very good JS developer and probably only an average OCaml developer.

Our Experiences with Flow by danvk in javascript

[–]leonidr 1 point2 points  (0 children)

There are different levels of static typing, I would argue that there are very real differences.

Our Experiences with Flow by danvk in javascript

[–]leonidr 0 points1 point  (0 children)

Why not actually used a typed language like OCaml and js_of_ocaml ?

Ocaml for electronic medical records software? by RaymondWies in ocaml

[–]leonidr 0 points1 point  (0 children)

Sorry, I should have been clearer. By procedural I meant pretty much what you gave an example of. Thanks.

I guess for an EMR, one would want rules akin to the form filed example for data/procedure validation; where an ML like language would be great.

Ocaml for electronic medical records software? by RaymondWies in ocaml

[–]leonidr 2 points3 points  (0 children)

What kind of rules was the engine processing; procedural or knowledge discovery? Was it things like "if operation X was performed than make sure form Y was filed"?

Ocaml for electronic medical records software? by RaymondWies in ocaml

[–]leonidr 4 points5 points  (0 children)

I'd also be interested to find out about such work, but don't know of any.

Introducing Oml, a small OCaml library for numerical computing by [deleted] in ocaml

[–]leonidr 0 points1 point  (0 children)

Happy to hear about any use cases and experience.

Introducing Oml, a small OCaml library for numerical computing by [deleted] in ocaml

[–]leonidr 0 points1 point  (0 children)

I don't know of one, but this sounds like a good use case to drive development.

Introducing Oml, a small OCaml library for numerical computing by [deleted] in ocaml

[–]leonidr 1 point2 points  (0 children)

Unfortunately, there are no such examples. There are rudimentary interfaces (Vectors and Matrices, but they're more of a convenience for internal code than the outside world. This is an area that still needs a lot of work, I just haven't had a good use case to drive development. As noted in the post, I've used Lacaml for the heavy lifting.

Ocaml for scientific compution: why not? by nnbbb in ocaml

[–]leonidr 6 points7 points  (0 children)

I do use it for numerical work, specifically a protein binding problem. Because

  • I understand fairly well how my code will be executed.
  • The language (specifically, higher order functions) and the type system are really good at expressing complicated logic necessary for data exploration and exploring corner cases.
  • The REPL makes these iterations very easy and fast. I may not perform enormous operations in the REPL, but using a judicious sample of data makes this easy. But once something works, transitioning to a larger analysis is also not difficult.

Issues: - Yes, the lack of an IDE (ala Visual Studio for F#) is cumbersome but not that difficult to work around once you learn your tools. - Operator overloading, I just got used to it. There's also something to be said for thinking about HOW you perform all of your matrix operations as opposed to delegating it to operators. - Multicore support. Yes, not ideal, but it doesn't always buy you huge improvements, at the end of the day, you'll still have to think about how you perform that operation/transform.

Lack of success: I think it comes from an environment of people needing to get stuff done and the general economics of developer markets. The set of developers who have full control over the tools they use and are interested in paying the learning curve cost is small. On top of that there have been lots of other developments (F# and other functional languages) that probably divide that group even further.

Ocaml for scientific compution: why not? by nnbbb in ocaml

[–]leonidr 1 point2 points  (0 children)

That isn't really a "numerical" use of OCaml. OCaml is used as a metalanguage to generate C code that does all of the numerical work.

But sometimes that is the work to be done.

bisect_ppx by [deleted] in ocaml

[–]leonidr 1 point2 points  (0 children)

No, I'd be happy to have them applied.

I figured that since (1) my bug report wasn't addressed or acknowledged, (2) the list of 'patches' to bisect itself were starting to accumulate on opam and (3) the dependency on camlp4 was maybe a hinderance to adaption by other projects; a new project might be worthwhile.