4 ms·
Pray tell, what are your personal programming languages?
by GeorgeTirebiter 4y ago
Pray tell, what are your personal programming languages?
- phoe-krk 4y agoLisp and Erlang. The latter doesn't have a numeric tower but has automatic bigint conversion and handling. The former is eager to error upon signed/unsigned type violations once you specify them.
- jcelerier 4y ago> has automatic bigint conversion how can one implement this without a branch before literally any arithmetic operation?
- throwawaymaths 4y agoYou're not using Erlang for speed. You're using Erlang for reliability. (Note this is not the same thing as correctness or "safety")
- phoe-krk 4y agoIn CL, you can declare that you need modulo arithmetic, which will give you branchless arithmetic operations. In Erlang, you don't; the language was never made for that sort of speed.
- bitwalker 4y agoErlang checks for overflow after arithmetic ops are performed internally (IIRC), so you are generally only penalized when overflow actually occurs and requires promotion, which probably isn’t much different in performance from a language that would raise an error on overflow, though obviously not as efficient as a language that just wraps around on overflow.
- AlexSW 4y agoNot sure Erlang is strong on the basic types front on the whole though; I've never been a fan of strings in Erlang. Greatly prefer C++ on this front.
- bitwalker 4y agoErlang binaries on the other hand are awesome, and the use of lists in what Erlang refers to as chardata/iodata is really nice when generating data that will be written to some kind of output device, since no preprocessing is needed to convert the data to a flat array of bytes. Overall though, yeah, it plays pretty loose with types, though it is generally strict about not using integers where floats are expected and vice versa.