One way you might arranging programming languages in a 2D space is with two axes: 1. How much should the language surprise you? 2. When the language does surprise you, should it delight you or horrify you? surprising ^ | | | delight horrify | | | v unsurprising Only a sadist would deliberately design a language for the top right quadrant, but there are many esoteric languages in there. I think most people tacitly ass…
The problem is those are subjective axes. And things can both delight and horrify; I wrote some javascript once where I did document.write = function ... which is kind of delightful in that I was able to do what I needed as a result, but also pretty horrifying :) Other people I showed it to felt it was more on the horrifying side, but like I said, it's subjective.
Raku: A language for gremlins
91–100 of 257 posts
Re: Raku: A language for gremlins
#92My favorite feature of Raku: Integer division and decimal literals both return `Rat`, a rational fraction type. Even though everyone knows floats suck, nobody is actually moving away from them except Raku. If you want a float literal you specifically have to use scientific notation.
Re: Raku: A language for gremlins
#93Earlier quoted context omitted.
It doesn't actively push you there, which is why it's on the bottom half. There is a fairly coherent mental model for C and once you have it, the language rarely surprises you. But when it does surprise you, it's almost never anything good. Stuff like Duff's device, `3[someArray] = value`, etc. The surprises are always the language's raw machinery showing through in unpleasant ways, and never a delightful bonus featu…
> The surprises are always the language's raw machinery showing through in unpleasant ways, and never a delightful bonus feature the designers added for you. I was reading "Writing Solid Code" by Steve Maguire (though it should really be called "how to write code in C without shooting yourself in the foot"). One thing that surprised me, but which made sense, was that pointers can overflow. It's unlikely, and ANSI non…
Re: Raku: A language for gremlins
#94Re: Raku: A language for gremlins
#95This is actually cool
Re: Raku: A language for gremlins
#96Earlier quoted context omitted.
> The surprises are always the language's raw machinery showing through in unpleasant ways, and never a delightful bonus feature the designers added for you. I was reading "Writing Solid Code" by Steve Maguire (though it should really be called "how to write code in C without shooting yourself in the foot"). One thing that surprised me, but which made sense, was that pointers can overflow. It's unlikely, and ANSI non…
Gone through a whole range of emotions looking at this. Tried to put together an argument about the high bits of (common) address spaces being zero and therefore it's safe but I don't think that works. It's the while (i++ < UINT32_MAX) bug in different clothing. Would make for a cruel take on the interview question of "tell me what bugs you see in this function".
Yep; on AMD64, bits 48 through 63 must be identical to bit 47, which can be 1 or 0, akin to sign extension.
In practice, I don't think any sane OS would let you reserve the very last n bytes of memory, especially not with an address space as large as that of AMD64, but you can't assume the architecture, and you don't always have an operating system.
And yeah, you could see the same bug with integer array indices, if signed integers wrap.
/* Endless loop if end == INT_MAX */
for (int i = 0; i Re: Raku: A language for gremlins
#97"If you define a MAIN function, any parameters you give it will be automatically turned into CLI flags." This is actually cool
Re: Raku: A language for gremlins
#98Earlier quoted context omitted.
The problem is those are subjective axes. And things can both delight and horrify; I wrote some javascript once where I did document.write = function ... which is kind of delightful in that I was able to do what I needed as a result, but also pretty horrifying :) Other people I showed it to felt it was more on the horrifying side, but like I said, it's subjective.
I was thinking axes of 'readability' and 'expressiveness' would make a nice chart for programming languages.
e
|
|
|
-r ------------- r
|
|
|
-eRe: Raku: A language for gremlins
#99One way you might arranging programming languages in a 2D space is with two axes: 1. How much should the language surprise you? 2. When the language does surprise you, should it delight you or horrify you? surprising ^ | | | delight horrify | | | v unsurprising Only a sadist would deliberately design a language for the top right quadrant, but there are many esoteric languages in there. I think most people tacitly ass…
Re: Raku: A language for gremlins
#100Earlier quoted context omitted.
I was thinking axes of 'readability' and 'expressiveness' would make a nice chart for programming languages.
As long as the negative sides of both axes are included too. e | | | -r ------------- r | | | -e