2,011 reputation
615
bio website
location Helsinki, Finland
age 26
visits member for 2 years, 7 months
seen Jun 4 at 17:19

Nov
8
comment Are there any technical obstacles for implementing `function* ()` syntax
@shabunc yes, you can't just introduce changes that will break existing websites
Oct
24
comment What are the safety benefits of a type system?
@Giorgio with such definition for example Java is not strongly typed. But in many cases it is claimed to be. There is just no meaning to these words. Strong/Weak typed have much more accurate definition as "I like/don't this language" like jozefg says.
Oct
24
comment What are the safety benefits of a type system?
It is also not useful to say interpreted language... about a language implementation yes, but not the language itself. Any language can be interpreted or compiled. And even after the edit you are using the terms strong and weak typing.
Oct
23
comment What are the types of dynamically typed languages arrays?
Well, it is not efficient because it's an additional level of indirection.
Oct
23
comment What are the types of dynamically typed languages arrays?
@ViliamBúr That's not true at all. That doesn't even make sense, the Javascript language doesn't dictate how implementation should actually represent arrays as long as everything looks the same to the user.
Oct
23
comment What are the types of dynamically typed languages arrays?
@FlorianMargaine well in V8 you would have "Object*". Then you would read the 2 smallest bit to see if it's even a pointer at an object, an error or a direct SMi (small integer) embedded. If it's a pointer at an object, then you can dereference it and see what kind of object it is because MapPointer is always the first field of any heap object and describes what type it is.
Oct
23
comment What are the types of dynamically typed languages arrays?
@FlorianMargaine well not literally a void * but the same idea yes
Sep
20
comment Correct comment to put for boolean function arguments that are “false”?
use enums (even if there is just 2 options) instead of bools
Sep
19
comment Does setting a function public affect the C# compiler's ability to inline the function as an optimization?
The IL is completely useless to answer any kind of optimization or performance question - always check the generated machine code from JIT.
Sep
4
comment Is try-finally expensive
Exceptions are not necessarily rare in practice, it's just accidental side effect. For example if you have bad UI people might cause the exception use case flow more often than the normal flow
Aug
30
comment Avoiding boilerplate in PHP classes
Again, macros solve mistyping :P
Aug
30
comment Avoiding boilerplate in PHP classes
Well that's not what DRY is about, it is about not duplicating knowledge. You are taking it to literally mean any kind of duplication, like the duplication of letters in a sentence for isntance.. that is crazy
Aug
30
comment Avoiding boilerplate in PHP classes
Even the most primitive text editor macros would solve this
Aug
28
comment Why does division and multiplication by 2 use the shift operator rather than division operator?
@delnan for divisions it requires the compiler to know that the dividend is always positive. Since this was tagged programming-languages, not C. e.g. In Java knowing that might not be possible because there is no unsigned integers. Therefore the optimized code has checks which manual code wouldn't have.
Aug
27
comment Is it considered bad practice to compile into Javascript as a matter of language preference?
@ryanSrich that is my point when I say the performance claims were ridiculous - especially dynamic languages with different semantics from JS need to emit runtime calls everywhere to be correct. So you are then running ruby on top of javascript, which will perform horribly. It could be enough for some toy demos but good luck if you made a real application on top of it. Also Opal does something really nasty to avoid runtime FunctionCall function required for method missing - it defines every possible function on some top level prototype as method missing.
Aug
27
comment Is it considered bad practice to compile into Javascript as a matter of language preference?
let us continue this discussion in chat
Aug
27
comment Is it considered bad practice to compile into Javascript as a matter of language preference?
@SK-logic By direct I mean Source string -> AST -> machine instructions. That's just one IR. Compiling literally directly from the source string seems absurd to me. This is how V8 is different from spidermonkey, which has "byte codes" or IL, which is interpreted. I believe the original intention was to claim that every engine is like spidermonkey in this sense.
Aug
27
comment Is it considered bad practice to compile into Javascript as a matter of language preference?
@StefanBilliet Yes, code is compiled directly to generic machine code by the general compiler, there is no interpretation at all like in SpiderMonkey. Hot functions then get analyzed and recompiled to specialized code by the optimizing compiler.
Aug
27
comment Is it considered bad practice to compile into Javascript as a matter of language preference?
@SK-logic I do not think it's useful definition to say IR is IL at all. V8 just has data structures about the code, not IL like firefox or IE has. Although you can use that definition but then what's the point because everything has an IL then unless they somehow directly use the source string without parsing it into IR first.
Aug
26
comment Is it considered bad practice to compile into Javascript as a matter of language preference?
Well no. V8 doesn't have IL at all.