[1] https://discourse.ubuntu.com/t/trying-wayland-by-default-aga...
2,167 karma · joined October 25, 2014
[1] https://discourse.ubuntu.com/t/trying-wayland-by-default-aga...
If a lower level web toolkit is sufficient then ocaml's cohttp [3] library has been available on mirage for quite some time now.
[1] https://github.com/ocsigen/lwt/
> A big part of the reason is that tools suck as Buck (which, like Bazel, uses Skylark as the language, which is a very limited python in essence) avoid the general programming patterns to avoid the issues described here.
I also agree with this. My current language of choice is OCaml and the most popular build tool is dune [1], which uses an s-expression based configuration language, and its nice to have a more restrictive DSL that avoids some pitfalls of using a full blown programming language for configuring builds.
[1] https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1...
In OCaml ref is defined as
type nonrec 'a ref = 'a ref = { mutable contents : 'a }
so it is an immutable record which contains one item which is mutable.> In any case, the idea of outright changing a formerly mutable structure to an immutable one would be unthinkable in most languages due to all the breakages it is likely to cause.
I agree with you. I started using OCaml in 2018 but I believe many linux distributions stayed on OCaml 4.05 (the release before safe-string was default) for a while because of breakages.
Maybe I'm missing something in SML, but OCaml has `ref` as well and it works just like SML's?
let x = ref 0
x := 12
print_int !x
> SML strings are immutable which lends itself to a lot of potential optimizations (and there's always byte arrays if you actually need to mutate).OCaml's strings are also immutable. They have been immutable by default since 2017 and prior to that one could opt into this behavior via a compiler flag.
I skipped classes to avoid doing that, i bombed many a presentation because I had trouble with certain sentences and it impacted my grades. I think not being able to make the best of time in grad school is something I can get over eventually, but a bigger regret I have is not being able to make meaningful connections with my peers in school because I'd avoid hanging out with people because of my anxiety over my stutter. In a way it almost feels like I never experienced
I still have issues with words starting with "A" which is unfortunate since my name starts with an A. I still speak really quickly which i think comes from a habit of trying to get through speech quickly to get it over with.
I do believe that a lot of it is mostly because of my anxiety as I speak just fine when i'm relaxed, and I've been trying to work on using different words when I feel like certain phrases/words will cause problems.
I really like Thunderbird, but if you need to use exchange and are on linux I think there isn't a nicer option than Evolution at the moment. It plays nice with all MS services and integrates with the OS for contacts, calendar etc.
Ofcourse all of this only applies if you are using Linux and its possible evolution is annoying on non gnome systems (i haven't tried it outside of gnome). I think kmail also has exchange support but i haven't tried it.
I might be in the small group who wants this, but i wish it was easy to find a 15" laptop with a CPU like the one in oryx but without an NVIDIA gpu. I'd like to have a better cpu and i don't mind a laptop that's larger than the xps 13 or carbon, but i don't need/want a dedicated nvidia gpu. While we are wishing for things, please make more laptops with higher dpi screens. There are a lot of options for 1080p or lower, but very few good options (outside of macbooks or dell xps) that have high quality UHD displays.
I'm on the market for a new laptop and the screen quality is the only reason i'm even contemplating a macbook.
I still use tumbleweed, but with Gnome and this has been my distro of choice for the past couple of years. (I moved from Ubuntu)
Another reason is the lack of push notification (not sure if i'm using the right term) when using the built in gmail app for fastmail. It only gives me the option to poll every 15 minutes. The gmail app also doesn't support actions like snooze, swipe to archive etc on non-gmail accounts and I like having that in the fast mail app.
For my personal use i've been using the Huawei Matebook X pro since last year. Things i dislike: no linux driver for the fingerprint scanner, there wasn't an option for me to buy the model with 16GB ram without Nvidia (its not a problem if you plan to run Ubuntu, etc). Things i like about it: The screen (3:2 screen is growing on me), the built quality seems really nice, its light but feels very sturdy. Good port selection, It has two USB-C + 1 regular USB-A port. The battery life is really good.
The other feature I like in dedicated password managers is that they tend to have a lot more options about what kind of password/passphrase you can generate. Some other features that i regularly use is storing non password content like software licenses, sharing certain passwords with my spouse, etc.
Remote: Yes
Willing to relocate: No
Technologies: OCaml, C++, Rust, Elixir, Typescript, Scala
Github: https://github.com/anuragsoni
Email: hackernews@sonianurag.com
Linkedin: https://www.linkedin.com/in/anuragsoni13/
Résumé: Available on the Linkedin page. I can email a pdf copy on request.
Currently working as a full-stack engineer. I'm looking to transition back to a more backend focussed role. Most of my work experience has been using C++ to build backend systems, but i've recently been using Typescript (with Angular) and Java for my current team at work.
Outside of work my current interests have been OCaml and working on improving the OCaml story for web usecases. example: https://github.com/anuragsoni/routes
On a similar note i find the OCaml syntax easier to read than Reason's. (There is an option to toggle between the two in the linked website)
The example from your post in OCaml:
type 'a restricted_maybe =
| JustInt : int -> int restricted_maybe
| JustString : string -> string restricted_maybe
| Nothing : 'a restricted_maybehttps://github.com/anmonteiro/ocaml-h2 - HTTP2 stack
https://github.com/inhabitedtype/httpaf - HTTP stack
For micro-frameworks there are a few options available like
https://github.com/rgrinberg/opium
https://github.com/ostera/httpkit
There are some scattered pieces in the ecosystem for routing, sessions etc but i agree that compared to Python, JS, etc the ecosystem might not look as cohesive or expansive for web applications. So there should definitely be room to have new solutions in this space
[1] https://github.com/ocaml/merlin.git
EDIT: I'd also like to point out OCamlformat (https://github.com/ocaml-ppx/ocamlformat). It works really well in my experience and makes it really easy to perform automatic code formatting, and can be used in CI to check that changed conform to the formatting style a project prefers.
This won't be the most efficient way to perform routing in an application, but i found the implementation really simple to understand and the error messages for the end-user seem really clear as well. It also helps if the language used allows for embedding DSLs that are easy to read for the end-user. (could be macros in lisp/elixir, well named functions with a little sprinkling of infix operators in OCaml, Haskell etc)
A little show HN in the comments: I've been exploring this approach and others [2] for comparison, and although i've moved away from this style as I progress in learning more OCaml, it was a fun little exercise to explore a CPS based typed routing approach. [3]
[1] https://dbp.io/talks/2016/fn-continuations-haskell-meetup.pd...
[2] https://github.com/anuragsoni/routes
[3] https://github.com/anuragsoni/routes/blob/0.1.0/src/routes.m...
For example:
match <something that returns result> {
Ok (v) => <do something with v>,
Err (some error) => <handle error>
}
By using the result type, the compiler ensures that the only way to get a value out of the result type is via pattern matching. So the errors are still values, except there is no need to come up with a default value for the error scenario, and there is no need to come up with an "empty" value.In isolation it might look verbose, but rust also provides a lot of higher order operations that one can do on result types. Ex:
myResult.map(<do-something>).and_then(sq).or_else(<do-something-else>);
Something else that I personally like about a result type is that it also serves as documentation by clearly marking operations that can fail, and have a consistent way for the end-user to know which value indicates that the response is a success or an error.EDIT: Formatting