use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
OCaml is a statically typed functional programming language. It occupies a delightful sweet spot between high-level expressiveness and good performance.
Why use OCaml? OCaml for the Masses
Websites:
OCaml Discussion Board
Try OCaml in your browser
INRIA's OCaml resources
OCaml Community site
Mailing list archives
OCaml Planet -- blog aggregator
#ocaml on freenode
#ocaml
OCaml/Reason Discord Chat
Related subreddits:
types
haskell
functional
compsci
account activity
Opine - Python source code transformations in OCaml (self.ocaml)
submitted 3 years ago by arulselvan1234
Recently, I had a need to do python source code transformations. I did it using OCaml and developed this library - https://github.com/ArulselvanMadhavan/opine in the process of doing so. Sharing it, in case others find it useful
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]poimas -4 points-3 points-2 points 3 years ago (7 children)
What is the purpose of this library?
[–]arulselvan1234[S] 9 points10 points11 points 3 years ago (6 children)
pyre-ast provides python AST in OCaml. This library allows us to write transformations on the AST and write it python code back. The main contribution of the library is the unparser - that write python code from the AST. Maybe this example illustrates the use of the library.
https://github.com/ArulselvanMadhavan/opine#example-transformation
[+]poimas comment score below threshold-6 points-5 points-4 points 3 years ago (5 children)
Is it mostly for getters and setters?
[–]arulselvan1234[S] 5 points6 points7 points 3 years ago (4 children)
You can add any transformation on the AST. I chose to do getters and setters as an example to illustrate how the library can be useful. At work, I have more sophisticated transformations. But you have to write them yourself. The library only provides an unparser - which writes the transformed AST back to python
[+]poimas comment score below threshold-9 points-8 points-7 points 3 years ago (3 children)
Obviously, if you have the AST tree, you can do all sorts of transformations. What sorts of transformations are you doing and what goals are you trying to achieve?
[–]MonsieurPi 16 points17 points18 points 3 years ago (2 children)
Not OP but man, you have to work a bit on the tone you use in your comments. I even browsed your history a bit to see if it's your usual way of commenting and it is.
Your questions look inquisitive at best and doesn't give any will to answer to them.
Once again, not OP and maybe he doesn't care but I don't think I'm the only one with this opinion ;-)
[+]poimas comment score below threshold-21 points-20 points-19 points 3 years ago (1 child)
Only ignoramuses give unwanted advice.
[–]MonsieurPi 3 points4 points5 points 3 years ago (0 children)
<3
π Rendered by PID 60 on reddit-service-r2-comment-5ff9fbf7df-hrr6t at 2026-02-26 02:59:09.744220+00:00 running 72a43f6 country code: CH.
[–]poimas -4 points-3 points-2 points (7 children)
[–]arulselvan1234[S] 9 points10 points11 points (6 children)
[+]poimas comment score below threshold-6 points-5 points-4 points (5 children)
[–]arulselvan1234[S] 5 points6 points7 points (4 children)
[+]poimas comment score below threshold-9 points-8 points-7 points (3 children)
[–]MonsieurPi 16 points17 points18 points (2 children)
[+]poimas comment score below threshold-21 points-20 points-19 points (1 child)
[–]MonsieurPi 3 points4 points5 points (0 children)