4 ms·
(OCaml Question Ahead) I agree on F#. It changed my C && OO perspective in fantastic ways, but I too can't support anything Microsoft anymore. But, seeing as
by MrMcCall 2y ago
(OCaml Question Ahead)
I agree on F#. It changed my C && OO perspective in fantastic ways, but I too can't support anything Microsoft anymore.
But, seeing as OCaml was the basis for F#, I have a question, though:
Does OCaml allow the use of specifically sized integer types?
I seem to remember in my various explorations that OCaml just has a kind of "number" type. If I want a floating point variable, I want a specific 32- or 64- or 128-bit version; same with my ints. I did very much like F# having the ability to specify the size and signedness of my int vars.
Thanks in advance, OCaml folks.
- neonsunset 2y agoF# is a far better option from a practical standpoint when compared to alternatives. By simple virtue of using .NET and having access to very wide selection of libraries that make it a non-issue when deciding to solve a particular business case. It also has an alternate compiler Fable which can target JS allowing the use of F# in front-end. Other options have worse support and weaker tooling, and often not even more open development process (e.g. you can see and contribute to ongoing F# work on Github). This tired opinion ".net bad because microsoft bad" has zero practical relevance to actually using C# itself and even more so F# and it honestly needs to die out because it borders on mental illness. You can hate microsoft products, I do so too, and still judge a particular piece of techology and the people that work on it on their merits.
- MrMcCall 2y agoI was asking about whether or not OCaml has the ability to target specific integer size and signedness, as F# does. I would like to construct precise software that targets the specific kinds of ints that compilers have historically facilitated microprocessors to process, but using a functional language instead of C or C++. The F# folks (including Don Syme) did a fantastic job on the early versions of the language (I used it up to ver 2 or early 3), but I am tired of the corporate engine that funds that ecosystem. I now construct my software within an operating system of a different pedigree. Such considerations are important to me, but thanks for sharing your preference. As for me, I hate nothing or no one, but I am as picky as a poor man can be about whom I choose to rely on for my tools. As for your opinion on the borderlands of mental illness, I'll contact you at your outlook email address should I seek your opinion about such differently-technical topics. But I was only asking if the OCaml compiler can target specific varieties of ints, as the .NET compiler does.
- throw16180339 2y agoI'm a novice OCaml user, but AFAIK here's how it works. int is pointer-sized minus one bit, e.g. 31 on 32-bit, 63 on 64-bit nativeint is pointer-sized, but boxed. float is 64-bit and boxed. There's limited support for different number sizes or specifying signedness.
- MrMcCall 2y agoThanks for your kind reply. In my occasional explorations over the years, that, too, is basically the gist of what I've gathered. F#, being based upon the .NET compiler and runtime, allows specific targeting of both int size and signedness. I'm surprised that OCaml doesn't also allow that, seeing as its compiler has a long pedigree with respect to both programming contests and real-world hardcore software systems (such as trading desk software). I remember first learning of it around two decades ago as a team used it to win the ICFP contest. I guess that such specificity is just outside of the concerns of the OCaml folks.