OCaml Planet

July 23, 2016

Functional Jobs

Database of the Web DevOps at Ahrefs (Full-time)

What we need

Ahrefs is looking for a linux wizard to take care of its 500+ server fleet and carry responsibility to keep all systems up and running 24/7.

Ideal candidate will :

  • foresee problems and prevent them from happening
  • setup and document procedures for common tasks
  • manage infrastructure monitoring
  • automate everything and then some
  • keep tabs on security
  • be able to debug problems on live production system
  • have healthy detestation for complex shell scripts

Availability for on-call rotation is required.

Our system is big part custom OCaml code and also employs the following third-party technologies:

  • LAMP
  • ELK
  • puppet

Who we are

Ahrefs runs an internet-scale bot that crawls the whole Web, storing huge volumes of information to be indexed and structured in a timely fashion. Backend system is powered by a custom petabyte-scale distributed key-value storage to accommodate all that data coming in at high speed. On top of that Ahrefs is building various analytical services for end-users.

We are a small team and strongly believe in better technology leading to better solutions for real-world problems. We worship functional languages and static typing, extensively employ code generation and meta-programming, value code clarity and predictability, and are constantly seeking to automate repetitive tasks and eliminate boilerplate, guided by DRY and following KISS. If there is any new technology that will make our life easier - no doubt, we'll give it a try. We rely heavily on opensource code (as the only viable way to build maintainable system) and contribute back, see e.g. https://github.com/ahrefs .

Our motto is "first do it, then do it right, then do it better".

What you get

We provide:

  • Competitive salary
  • Informal and thriving atmosphere
  • First-class workplace equipment (hardware, tools)
  • Medical insurance
  • No dress code

Locations

Singapore : modern office in CBD

USA : cozy loft in San Francisco downtown

Get information on how to apply for this position.

July 23, 2016 12:27 AM

July 18, 2016

OCamlCore Forge News

Cryptokit 1.11 released

Cryptokit version 1.11 uses the "safe string" mode of OCaml 4.02 and up, adds support for hardware-accelerated AES and random number generation for x86 processors, and fixes minor bugs in validation of function arguments. Also, RSA and DH now use ZArith to perform arithmetic, resulting in better performance and resistance to timing attacks.

by Xavier Leroy at July 18, 2016 06:24 PM

July 11, 2016

Coq

Coq 8.5pl2 is out

Version 8.5pl2 of Coq is available. It fixes several bugs of version 8.5pl1, including one critical bug. More information can be found in the CHANGES file. Feedback and bug reports are extremely welcome.

by Maxime Dénès at July 11, 2016 12:00 AM

June 30, 2016

Functional Jobs

Software Engineer (ClojureScript, F#) at Xledger (Full-time)

Xledger is a finance, project, and business information system that gives customers tighter control of their businesses.

We are expanding our team in Colorado Springs, which focuses on Clojurescript (with Om), F#, and SQL Server. We're looking for engineers who can make a strong contribution to this stack, helping us create best-in-class functionality for our customers.

Requirements:

  • An understanding of how the web and web applications work (HTTP, databases, caching, API's, etc)
  • Ability to do solid work in multiple areas, such as data access, caching, front end, etc
  • Ability to pick things up quickly
  • High standards
  • Ability to focus and get things done
  • Experience with functional programming languages like Clojurescript, F#, OCaml, Elixir, Scala, etc (could overlook this for jr. candidates)
  • Legally able to work in the U.S.

Nice to have:

  • Front end experience with Clojurescript

Other technology involved

  • Redis
  • Git
  • ASP.NET
  • C#

We are currently not offering any remote positions.

Get information on how to apply for this position.

June 30, 2016 05:24 PM

June 27, 2016

Github OCaml jobs

Full Time: Software Developer (Functional Programming) at Jane Street in New York, NY; London, UK; Hong Kong

Software Developer

Jane Street is a proprietary quantitative trading firm, focusing primarily on trading equities and equity derivatives. We use innovative technology, a scientific approach, and a deep understanding of markets to stay successful in our highly competitive field. We operate around the clock and around the globe, employing over 400 people in offices in New York, London and Hong Kong.

The markets in which we trade change rapidly, but our intellectual approach changes faster still. Every day, we have new problems to solve and new theories to test. Our entrepreneurial culture is driven by our talented team of traders and programmers. At Jane Street, we don't come to work wanting to leave. We come to work excited to test new theories, have thought-provoking discussions, and maybe sneak in a game of ping-pong or two. Keeping our culture casual and our employees happy is of paramount importance to us.

We are looking to hire great software developers with an interest in functional programming. OCaml, a statically typed functional programming language with similarities to Haskell, Scheme, Erlang, F# and SML, is our language of choice. We've got the largest team of OCaml developers in any industrial setting, and probably the world's largest OCaml codebase. We use OCaml for running our entire business, supporting everything from research to systems administration to trading systems. If you're interested in seeing how functional programming plays out in the real world, there's no better place.

The atmosphere is informal and intellectual. There is a focus on education, and people learn about software and trading, both through formal classes and on the job. The work is challenging, and you get to see the practical impact of your efforts in quick and dramatic terms. Jane Street is also small enough that people have the freedom to get involved in many different areas of the business. Compensation is highly competitive, and there's a lot of room for growth.

You can learn more about Jane Street and our technology from our main site, janestreet.com. You can also look at a a talk given at CMU about why Jane Street uses functional programming (http://ocaml.janestreet.com/?q=node/61), and our programming blog (http://ocaml.janestreet.com).

We also have extensive benefits, including:

  • 90% book reimbursement for work-related books
  • 90% tuition reimbursement for continuing education
  • Excellent, zero-premium medical and dental insurance
  • Free lunch delivered daily from a selection of restaurants
  • Catered breakfasts and fresh brewed Peet's coffee
  • An on-site, private gym in New York with towel service
  • Kitchens fully stocked with a variety of snack choices
  • Full company 401(k) match up to 6% of salary, vests immediately
  • Three weeks of paid vacation for new hires in the US
  • 16 weeks fully paid maternity/paternity leave for primary caregivers, plus additional unpaid leave

More information at http://janestreet.com/culture/benefits/

June 27, 2016 01:22 PM

June 26, 2016

OCaml Labs compiler hacking

Fourteenth OCaml compiler hacking evening at Citrix

​Our summer compiler hacking event will be hosted by Euan and the Citrix Team on Thursday 7th​ July — come and explore the other side of Cambridge and the Science Park!

If you're planning to come along, it'd be helpful if you could indicate interest via Doodle and sign up to the mailing list to receive updates.

Where: Citrix Systems Research & Development Ltd.
Building 10​1, ​ Cambridge
Science Park​,
Milton Road​,
Cambridge​
CB4 0FY​

When: 7pm, Thursday 7th July

Who: anyone interested in improving OCaml. Knowledge of OCaml programming will obviously be helpful, but prior experience of working on OCaml internals isn't necessary.

What: fixing bugs, implementing new features, learning about OCaml internals

Refreshments: pizza and beer/other drinks will be available.

Wiki: https://github.com/ocamllabs/compiler-hacking/wiki

We're defining "compiler" pretty broadly, to include anything that's part of the standard distribution, which means at least the standard library, runtime, tools (ocamldep, ocamllex, ocamlyacc, etc.), the debugger, the documentation, and the compiler itself. We'll have suggestions for mini-projects for various levels of experience, but feel free to come along and work on whatever you fancy.

by OCaml Labs (cl-ocamllabs@lists.cam.ac.uk) at June 26, 2016 07:15 PM

June 22, 2016

OCamlCore Forge News

Camlzip 1.06 released

Camlzip is a library to create and access compressed files in Zip and Gzip formats. This release fixes incompatibilities with OCaml 4.03 and adheres to "safe string" mode.

by Xavier Leroy at June 22, 2016 04:06 PM

June 17, 2016

Shayne Fletcher

Generic mappings over pairs

Browsing around on Oleg Kiselyov's excellent site, I came across a very interesting paper about "Advanced Polymorphism in Simpler-Typed Languages". One of the neat examples I'm about to present is concerned with expressing mappings over pairs that are generic not only in the datatypes involved but also over the number of arguments. The idea is to produce a family of functions $pair\_map_{i}$ such that


pair_map_1 f g (x, y) (x&apos, y&apos) → (f x, g y)
pair_map_2 f g (x, y) (x&apos, y&apos) → (f x x&apos, g y y&apos)
pair_map_3 f g (x, y) (x&apos, y&apos) (x&apos&apos, y&apos&apos, z&apos&apos) → (f x x&apos x&apos&apos, g y y&apos y&apos&apos)
.
.
.
The technique used to achieve this brings a whole bunch of functional programming ideas together : higher order functions, combinators and continuation passing style (and also leads into topics like the "value restriction" typing rules in the Hindley-Milner system).

let ( ** ) app k = fun x y -> k (app x y)
let pc k a b = k (a, b)
let papp (f1, f2) (x1, x2) = (f1 x1, f2 x2)
let pu x = x
With the above definitions, $pair\_map_{i}$ is generated like so.

(*The argument [f] in the below is for the sake of value restriction*)
let pair_map_1 f = pc (papp ** pu) (f : α -> β)
let pair_map_2 f = pc (papp ** papp ** pu) (f : α -> β -> γ)
let pair_map_3 f = pc (papp ** papp ** papp ** pu) (f : α -> β -> γ -> δ)
For example,

# pair_map_2 ( + ) ( - ) (1, 2) (3, 4) ;;
- : int * int = (4, -2)

Reverse engineering how this works requires a bit of algebra.

Let's tackle $pair\_map_{1}$. First


pc (papp ** pu) = (λk f g. k (f, g)) (papp ** pu) = λf g. (papp ** pu) (f, g)
and,

papp ** pu = λx y. pu (papp x y) = λx y. papp x y
so,

λf g. (papp ** pu) (f, g) =
λf g. (λ(a, b) (x, y). (a x, b y)) (f, g) =
λf g (x, y). (f x, g y)
that is, pair_map_1 = pc (papp ** pu) = λf g (x, y). (f x, g y) and, we can read the type off from that last equation as (α → β) → (γ → δ) → α * γ → β * δ.

Now for $pair\_map_{2}$. We have


pc (papp ** papp ** pu) =
(λk f g. k (f, g)) (papp ** papp ** pu) =
λf g. (papp ** papp ** pu) (f, g)
where,

papp ** papp ** pu = papp ** (papp ** pu) =
papp ** (λa' b'. pu (papp a' b')) =
papp ** (λa' b'. papp a' b') =
λa b. (λa' b'. papp a' b') (papp a b)
which means,

pc (papp ** papp ** pu) =
λf g. (papp ** papp ** pu) (f, g) =
λf g. (λa b.(λa' b'. papp a' b') (papp a b)) (f, g) =
λf g. (λb. (λa' b'. papp a' b') (papp (f, g) b)) =
λf g. λ(x, y). λa' b'. (papp a' b') (papp (f, g) (x, y)) =
λf g. λ(x, y). λa' b'. (papp a' b') (f x, g y) =
λf g. λ(x, y). λb'. papp (f x, g y) b' =
λf g. λ(x, y). λ(x', y'). papp (f x, g y) (x', y') =
λf g (x, y) (x', y'). (f x x', g y y')
that is, a function in two binary functions and two pairs as we expect. Phew! The type in this instance is (α → β → γ) → (δ → ε → ζ) → α * δ → β * ε → γ * ζ.

To finish off, here's the program transliterated into C++(14).


#include <utility>
#include <iostream>

//let pu x = x
auto pu = [](auto x) { return x; };

//let ( ** ) app k = fun x y -> k (app x y)
template <class F, class K>
auto operator ^ (F app, K k) {
return [=](auto x) {
return [=] (auto y) {
return k ((app (x)) (y));
};
};
}

//let pc k a b = k (a, b)
auto pc = [](auto k) {
return [=](auto a) {
return [=](auto b) {
return k (std::make_pair (a, b)); };
};
};

//let papp (f, g) (x, y) = (f x, g y)
auto papp = [](auto f) {
return [=](auto x) {
return std::make_pair (f.first (x.first), f.second (x.second)); };
};

int main () {

auto pair = &std::make_pair<int, int>;

{
auto succ= [](int x){ return x + 1; };
auto pred= [](int x){ return x - 1; };
auto p = (pc (papp ^ pu)) (succ) (pred) (pair (1, 2));
std::cout << p.first << ", " << p.second << std::endl;
}

{
auto add = [](int x) { return [=](int y) { return x + y; }; };
auto sub = [](int x) { return [=](int y) { return x - y; }; };
auto p = pc (papp ^ papp ^ pu) (add) (sub) (pair(1, 2)) (pair (3, 4));
std::cout << p.first << ", " << p.second << std::endl;
}

return 0;
}

by Shayne Fletcher (noreply@blogger.com) at June 17, 2016 07:39 PM