Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Actually they both (and OCaml has a whole lot of almost never used OOP - that's where the O comes from) have _way_ less "syntax" than Python or Java.


I just did some quick math. If you count all the keywords and operators for F# in microsoft's documentation, you come to 150 symbols. This doesn't include the nullary operators (of which there are 14)

Counting all the java operators and keywords, you get 84. This doesn't include assignment operators like "+=" or "-=" (11 such operators).

ChatGPT tells me that python has 36 keywords and 28 operators (not including the 13 assignment operators). This seems low and may be missing some syntactical sugar operators, but even then 64 is a far lower number than F#'s 150. Much debate could be had about which of these operators are fair to count or not, but it seems preliminarily that the data supports the position that functional programming languages (or at least F#) tend to go heavy on special keywords and operators


You're right, there actually are more. Interesting, I "feel" the opposite.

Haskell (55 + some more, because of the grouping): https://wiki.haskell.org/Keywords

F# https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...

OCaml: https://v2.ocaml.org/manual/lex.html#sss:keywords

Python: https://github.com/python/cpython/blob/3.12/Lib/keyword.py

Java (I think these are the current ones): https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_k...


A few of the Haskell ones are introduced by extensions, so they're not part of the language proper.


Yes, I know. Same for OCaml with PPXs. That was just to show that even Haskell has many, even though most operators aren't keywords but "normal" infix functions (of type classes).


> even though most operators aren't keywords but "normal" infix functions

yes, that is also important to mention




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: