9 ms·
OCamlEditor
- kev6168 12y agoOCaml and its ecosystem are becoming so enticing day by day I feel like I am running out of excuses not to dive in NOW :-) Obviously it's extremely powerful in many different domains. But one particular area I am interested in is mobile app development. Google search shows OCaml indeed has libs/tools for writing and compiling apps. I am curious about what's the current status and experience in using OCaml in Android/iOS development.
- pjmlp 12y agoIt will be the same pain as C and C++, outside the blessed NDK APIs, which are only game development related, it is JNI pain. As for the compiler I think it can already cross-compile to Android.
- kev6168 12y ago>> As for the compiler I think it can already cross-compile to Android. That's great to know. Also, if taking the js/html5 route, maybe Js_of_ocaml can help to ease the pain? I've heard nothing but good things about it.
- edwintorok 12y agoThere are two android-related repositories (I haven't built any applications with them though): https://github.com/whitequark/opam-android https://github.com/whitequark/opam-android https://github.com/vouillon/opam-android-repository https://github.com/vouillon/opam-android-repository
- martijn_himself 12y agoI think one of the most realistic options would be to explore F# on Xamarin, if you are willing to pay the indie subscription fee (for Xamarin, that is). F# is a superset of OCaml (well maybe not very strictly speaking but practically for all intents and purposes). Xamarin is gaining a lot of traction as a platform for writing native apps that deploy to Android and iOS. Personally I have very good experiences with both the language and the platform, I would recommend you check it out.
- orbifold 12y agoThat is not entirely true, there is some overlap but also enough distinct features on the language level to make a difference. For example object oriented features in OCaml are quite different, OCaml has a more powerful module system (functors), it has open polymorphic variants, extensible syntax. F# has also a number of features that Ocaml hasn't, but it is definitely not true that one is the superset of the other. The runtime situation is arguably also a matter of preference, Ocaml compiles down to fairly efficient machine code and has a well tuned garbage collector, whereas F# at least initially had to rely on a garbage collector that was tuned for a different use case.
- martijn_himself 12y agoYou give a very clear overview of the differences between the languages and I agree it is important to stress that there are significant differences between the two. The OP mentions mobile development though and if the goal is to ship apps targeting iOS and Android, it is not going to be practical to use OCaml- hence my suggestion.
- kev6168 12y agoFor me F#'s syntax is so clean and pleasant to look at, I just love it. But having been in the JVM land for too long, at the beginning I like to get a bit more 'native' and learn OCaml. Hopefully acquired functional programming knowledge can be transferred to F#+Xamarin app development later.
- jallmann 12y agoJeffrey Scofield has a OCaml cross-compiler for iOS [1], and a number of of example apps are available, including ones using OpenGL ES. The bridges connecting OCaml to iOS UI components are incomplete, so you might have to do a bit of work to support certain components, but the work would be reusable. Not difficult if you follow the example apps, but maybe tedious. I think the effort is worth it for what OCaml gives you. [1] http://psellos.com/ocaml/compile-to-iphone.html http://psellos.com/ocaml/compile-to-iphone.html
- StevePerkins 12y ago[meta] Nothing at all against OCaml, but it puzzles me where these HN micro-fads come from. There have inexplicably been a surge in OCaml posts on the front page over the past week. Which is perfectly fine, except that I haven't gotten around yet to learning Rust (i.e. last month's fad). I'm still busy digging into Go (i.e. the fad from six months ago), having grown bored with Scala (i.e. ancient history, at least a year or two). It is always exciting to see the fad spotlight shine on a mature language, since reaching production-ready status is usually the point at which languages stop being cool. However, the Haskell surge also rolls back around every few months, and they seem to think that OCaml isn't "pure" enough. So what to do? Are these short-lived bubbles the result of coordinated HN ranking manipulation, or do brief convergences of interest just spontaneously bubble up by coincidence? [/meta]
- Dewie 12y agoRust seems like a pretty consistent fad - it has come up in the last year pretty regularly, with the usual talking points (memory safety, systems languages, too immature for production, "when will 1.0 be released?"). Though I'm biased in that I actively seek out news on Rust.
- infruset 12y agoI think your answer is biased from a certain environment. In mine, Ocaml is definitely not a fad and any development is very exciting and definitely deserves the front page of Hacker News. Also, in my country, a sizeable percentage of engineers has gone through a least the basics of Ocaml.
- rwmj 12y agoAnyone wants to work on real, used-in-production OCaml code, take a look at the various libguestfs virt tools: https://github.com/libguestfs/libguestfs/tree/master/v2v https://github.com/libguestfs/libguestfs/tree/master/v2v https://github.com/libguestfs/libguestfs/tree/master/builder https://github.com/libguestfs/libguestfs/tree/master/builder https://github.com/libguestfs/libguestfs/tree/master/customize https://github.com/libguestfs/libguestfs/tree/master/customi... https://github.com/libguestfs/libguestfs/tree/master/resize https://github.com/libguestfs/libguestfs/tree/master/resize https://github.com/libguestfs/libguestfs/tree/master/sparsify https://github.com/libguestfs/libguestfs/tree/master/sparsif... https://github.com/libguestfs/libguestfs/tree/master/sysprep https://github.com/libguestfs/libguestfs/tree/master/sysprep One great no-nonsense feature of OCaml is that you can just link programs directly to C code, include a tiny C wrapper, and call straight into C with virtually no overhead (literally no overhead for functions that don't need to allocate on the OCaml heap).
- deleted 12y ago[deleted]
- goraci 12y agoI wish i could try this editor but had no luck compiling it. Some troubles with deps (lablgtk) and then infinite compile cycle issue i could not resolve. Would be nice to have deps included in install script or something.
- edwintorok 12y agoUsually it is a lot easier to try out OCaml applications using OPAM than building by hand, if your platform has OPAM available. What OS/distribution are you using? Also what compiler version, apparently it requires OCaml = 4.01: https://github.com/ocaml/opam-repository/pull/537#issuecomment-23628104 https://github.com/ocaml/opam-repository/pull/537#issuecomme...
- goraci 12y agoUbuntu 14.04. I used opam to install lablgtk ( before that installed gtk+2.0 ) also installed xml-light with opam and then got infinite loop when compiling. Ocaml 4+
- edwintorok 12y agoDid you run this before building?: eval `opam config env` I tried this Dockerfile and it succeeded, maybe compare your steps with the ones below. If it still doesn't work try moving this discussion to stackoverflow or the OCaml mailing list and provide the output when the infinite loop happens. FROM ubuntu:trusty RUN apt-get -y update && apt-get -y install opam aspcud && opam init -y RUN apt-get install -y m4 libexpat1-dev libgtk2.0-dev RUN opam install -y ocamleditor
- goraci 12y ago"opam install -y ocamleditor" finally did the trick ) thanks
- a0 12y agoSincerely this project should be moved to GitHub and a milestone for modernisation should be created (eg: port it to 4.02, add a plugin system to ease integration with code analysis and build tools, etc). Currently the only active developer (according to logs) is the original creator of the project, while the project has potential to be maintained by the community. Add to it a native graphics support for OS X, a decent documentation and suddenly you have a dream IDE.
- edwintorok 12y agoIt is on github too: https://github.com/ftovagliari/ocamleditor https://github.com/ftovagliari/ocamleditor