Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 03, 2013 Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
I just saw this talk: Higgs, a Monitoring JIT for JavaScript & Metacircular VM Layering https://air.mozilla.org/higgs-jit/ Maxime is using D to implement her JIT. More information on her blog, http://pointersgonewild.wordpress.com/2013/01/31/visiting-mozilla/ Source code is available at GitHub, https://github.com/maximecb/Higgs Nice to see projects that we can use as real life examples of D usage. :) -- Paulo |
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | On 2/3/13 2:46 AM, Paulo Pinto wrote: > I just saw this talk: > > Higgs, a Monitoring JIT for JavaScript & Metacircular VM Layering > > https://air.mozilla.org/higgs-jit/ > > Maxime is using D to implement her JIT. > > More information on her blog, > > http://pointersgonewild.wordpress.com/2013/01/31/visiting-mozilla/ > > Source code is available at GitHub, > > https://github.com/maximecb/Higgs > > Nice to see projects that we can use as real life examples of D usage. :) > > -- > Paulo http://www.reddit.com/r/programming/comments/17resr/higgs_a_monitoring_jit_for_javascript/ Andrei |
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | Paulo Pinto: > Source code is available at GitHub, > > https://github.com/maximecb/Higgs The code seems to miss the usage of contracts, foreach loops on numerical intervals, final switch, toString with sink, text() function, enum for compile-time constants, most const arguments, const on methods. Generally when you see several projects with the same "utility", it often means it should be in Phobos. So maybe something like this should be in Phobos: https://github.com/maximecb/Higgs/blob/master/source/util/misc.d Bye, bearophile |
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paulo Pinto | Paulo Pinto: > More information on her blog, > > http://pointersgonewild.wordpress.com/2013/01/31/visiting-mozilla/ I like the slides because they don't contain a page titled "Why D?" nor they talk about D: http://pointersgonewild.files.wordpress.com/2013/01/higgs-presentation.pdf Bye, bearophile |
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Sunday, 3 February 2013 at 11:26:54 UTC, bearophile wrote:
> Paulo Pinto:
>
>> Source code is available at GitHub,
>>
>> https://github.com/maximecb/Higgs
>
> The code seems to miss the usage of contracts, foreach loops on numerical intervals, final switch, toString with sink, text() function, enum for compile-time constants, most const arguments, const on methods.
>
My experience tells me that this is probably a good idea if you don't want to run into weirdland.
|
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | deadalnix:
>> The code seems to miss the usage of contracts, foreach loops on numerical intervals, final switch, toString with sink, text() function, enum for compile-time constants, most const arguments, const on methods.
>>
>
> My experience tells me that this is probably a good idea if you don't want to run into weirdland.
Among those things I have listed, probably the only ones that give a little of troubles are const on methods.
The author has used asserts at the beginning of methods, outside a the pre-condition, this is silly. Not using foreach loops on numerical intervals is a waste of fingers and increases the risk of mistakes, final switches often help you, text() is shorter than to!string(), const arguments are usually handy to avoid some troubles and make function/method signatures more informative.
Bye,
bearophile
|
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Sunday, 3 February 2013 at 13:56:13 UTC, bearophile wrote:
> deadalnix:
>
>>> The code seems to miss the usage of contracts, foreach loops on numerical intervals, final switch, toString with sink, text() function, enum for compile-time constants, most const arguments, const on methods.
>>>
>>
>> My experience tells me that this is probably a good idea if you don't want to run into weirdland.
>
> Among those things I have listed, probably the only ones that give a little of troubles are const on methods.
>
> The author has used asserts at the beginning of methods, outside a the pre-condition, this is silly. Not using foreach loops on numerical intervals is a waste of fingers and increases the risk of mistakes, final switches often help you, text() is shorter than to!string(), const arguments are usually handy to avoid some troubles and make function/method signatures more informative.
>
> Bye,
> bearophile
Welcome to reality Bearophile!!!
In real projects people do the job as best as they can at the moment, and they probably, and with right, do not care what people who only theorise, criticise, and philosophise think! You write perfect code?! I doubt! And if you do, you will probably never finish any serious project in time!
|
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dejan Lekic | Dejan Lekic: > In real projects people do the job as best as they > can at the moment, But often there's also some need for: http://en.wikipedia.org/wiki/Code_review Bye, bearophile |
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Sun, 03 Feb 2013 14:56:12 +0100 "bearophile" <bearophileHUGS@lycos.com> wrote: > > The author has used asserts at the beginning of methods, outside a the pre-condition, this is silly. Why is it silly? (Genuine question) > Not using foreach loops on numerical intervals is a waste of fingers and increases the risk of mistakes, final switches often help you, text() is shorter than to!string(), Yea, I agree there. Although I've found that the existence of text() is easy to overlook (and if I were looking for it, I'd be looking in std.string, though I realize it makes sense either way). Also, AIUI, "foreach(i; 0..10)" involves a range and function calls, so perhaps they want to be certain there isn't any overhead that accidentally fails to get optimized out? Plus they may be new to D, now be aware of things like "final switch" or exactly which of the advanced features are potentially problematic. |
February 03, 2013 Re: Higgs, a JavaScript JIT done in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dejan Lekic | On Sunday, 3 February 2013 at 18:24:05 UTC, Dejan Lekic wrote:
> Welcome to reality Bearophile!!!
>
> In real projects people do the job as best as they can at the moment, and they probably, and with right, do not care what people who only theorise, criticise, and philosophise think! You write perfect code?! I doubt! And if you do, you will probably never finish any serious project in time!
That's besides the point. If people aren't using a feature of the language (e.g. contracts or const) then perhaps it is a sign of problems with those features, whether it be technical, or lack of tutorial, or poor documentation etc. I don't know if it is, but I find it interesting to observe how people use the language in real code.
|
Copyright © 1999-2021 by the D Language Foundation