digitalmars.D.announce - Higgs, a JavaScript JIT done in D
- Paulo Pinto (11/11) Feb 02 2013 I just saw this talk:
- Andrei Alexandrescu (3/14) Feb 03 2013 http://www.reddit.com/r/programming/comments/17resr/higgs_a_monitoring_j...
- bearophile (11/13) Feb 03 2013 The code seems to miss the usage of contracts, foreach loops on
- deadalnix (3/11) Feb 03 2013 My experience tells me that this is probably a good idea if you
- bearophile (11/18) Feb 03 2013 Among those things I have listed, probably the only ones that
- Dejan Lekic (7/27) Feb 03 2013 Welcome to reality Bearophile!!!
- bearophile (5/7) Feb 03 2013 But often there's also some need for:
- Paulo Pinto (3/10) Feb 03 2013 If only most companies I worked for cared about it, or for
- Dejan Lekic (12/28) Feb 04 2013 I understand the girl is a researcher. They, especially if they are PhD
- Paulo Pinto (2/26) Feb 04 2013 100%
- MattCoder (6/41) Feb 04 2013 I agree too.
- Dejan Lekic (2/44) Feb 05 2013 I absolutely agree.
- Matthew Caron (7/10) Feb 05 2013 I don't, but that's because I hate JavaScript only slightly less than
- FG (4/11) Feb 05 2013 I have similar feelings regarding PHP and Javascript.
- Matthew Caron (10/18) Feb 05 2013 I have a rule - any language which does not have a method by which one
- Walter Bright (3/5) Feb 05 2013 Yeah, autodeclaration is one of those things that gets regularly "invent...
- bearophile (7/10) Feb 05 2013 Still, I prefer to use Python in many situations, like when I
- Matthew Caron (7/15) Feb 06 2013 See, I use D for that these days - then I port it to C if there's no D
- Matthew Caron (10/15) Feb 05 2013 Which is very difficult when attempting to bootstrap a new language into...
- Peter Alexander (7/13) Feb 03 2013 That's besides the point. If people aren't using a feature of the
- Paulo Pinto (2/15) Feb 03 2013 Specially in offshore projects....
- Rob T (15/29) Feb 04 2013 Good points.
- Rob T (5/5) Feb 04 2013 It would be nice to know why she choose D.
- Nick Sabalausky (12/19) Feb 03 2013 Why is it silly? (Genuine question)
- Peter Alexander (4/8) Feb 03 2013 There is no range or function calls! That syntax existed well
- bearophile (11/12) Feb 03 2013 "Silly" wasn't the right word, sorry.
- Peter Alexander (21/27) Feb 03 2013 I don't use D contracts, even though I use asserts.
- bearophile (21/41) Feb 03 2013 If you have to create some temporary values (or to perform some
- Timon Gehr (17/47) Feb 03 2013 If the code is written consistently in this vertically-bloated style, it...
- Michael (1/1) Feb 03 2013 Best code, it's which works and the client is satisfied.
- Nick Sabalausky (5/6) Feb 03 2013 And the end users are satisfied. AND doesn't cause problems when it
- Michael (1/1) Feb 04 2013 Yes, you are right. But it's all is just nuances )))
- Dejan Lekic (7/15) Feb 04 2013 AND you expect that from ONE, single person who is implementing somethin...
- Michael (3/17) Feb 04 2013 Yes, you are right. But it's all is just nuances )))
- Nick Sabalausky (4/18) Feb 09 2013 Just to be clear, I was replying to the comment about what qualifies as
- Matthew Caron (9/10) Feb 05 2013 In all fairness, I wasn't aware of text until this comment, so perhaps
- FG (6/8) Feb 05 2013 There are still many examples around with to!string, so it's easy not to
- Andrei Alexandrescu (3/13) Feb 05 2013 Care for a shotgun search/replace pull request?
- Adam D. Ruppe (4/4) Feb 05 2013 I prefer to!string to text() because you can use the same to!T
- Dmitry Olshansky (5/9) Feb 05 2013 Actually me too, to!string feels more explicit.
- Adam D. Ruppe (3/4) Feb 05 2013 to!int, etc too
- Walter Bright (2/5) Feb 05 2013 toto too!
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (3/5) Feb 05 2013 +1
- Andrej Mitrovic (21/22) Feb 05 2013 Looking at the implementation:
- Dmitry Olshansky (7/29) Feb 05 2013 Time to make Appender @trusted and linch the author if it's not that
- deadalnix (4/17) Feb 05 2013 I faced memory corruption in out contract and invariants in the
- bearophile (6/8) Feb 03 2013 I like the slides because they don't contain a page titled "Why
- Michael (4/4) Feb 06 2013 As she noted in its journal, maybe she give a keynote talk at
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
Feb 02 2013
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. :) -- Paulohttp://www.reddit.com/r/programming/comments/17resr/higgs_a_monitoring_jit_for_javascript/ Andrei
Feb 03 2013
Paulo Pinto:Source code is available at GitHub, https://github.com/maximecb/HiggsThe 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
Feb 03 2013
On Sunday, 3 February 2013 at 11:26:54 UTC, bearophile wrote:Paulo Pinto:My experience tells me that this is probably a good idea if you don't want to run into weirdland.Source code is available at GitHub, https://github.com/maximecb/HiggsThe 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.
Feb 03 2013
deadalnix: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, bearophileThe 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.
Feb 03 2013
On Sunday, 3 February 2013 at 13:56:13 UTC, bearophile wrote:deadalnix: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!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, bearophileThe 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.
Feb 03 2013
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
Feb 03 2013
Am 03.02.2013 19:58, schrieb bearophile:Dejan Lekic:If only most companies I worked for cared about it, or for that matter unit tests. :(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
Feb 03 2013
Paulo Pinto wrote:Am 03.02.2013 19:58, schrieb bearophile:I understand the girl is a researcher. They, especially if they are PhD students, have very strict deadlines, and have milestones to do. Finally, they in most cases work ALONE. With all due respect, but I find it disrespectful to criticise immediately the implementation, especially if it is something pretty serious. Finally, such critic, pull request, suggestion, whatever, should be directed *to the author herself*, or on project's mailing list, bugtrack, etc instead of posting here. Don't you agree? -- Dejan Lekic dejan.lekic (a) gmail.com http://dejan.lekic.orgDejan Lekic:If only most companies I worked for cared about it, or for that matter unit tests. :(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
Feb 04 2013
Am 04.02.2013 20:16, schrieb Dejan Lekic:Paulo Pinto wrote:100%Am 03.02.2013 19:58, schrieb bearophile:I understand the girl is a researcher. They, especially if they are PhD students, have very strict deadlines, and have milestones to do. Finally, they in most cases work ALONE. With all due respect, but I find it disrespectful to criticise immediately the implementation, especially if it is something pretty serious. Finally, such critic, pull request, suggestion, whatever, should be directed *to the author herself*, or on project's mailing list, bugtrack, etc instead of posting here. Don't you agree?Dejan Lekic:If only most companies I worked for cared about it, or for that matter unit tests. :(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
Feb 04 2013
On Monday, 4 February 2013 at 20:08:32 UTC, Paulo Pinto wrote:Am 04.02.2013 20:16, schrieb Dejan Lekic:I agree too. But one thing that I saw is we should getting happy to see another project using D, but the focus went to her code instead! Let's take easy, and be glad that she is promoting D. And by the way, the project looks awesome!Paulo Pinto wrote:100%Am 03.02.2013 19:58, schrieb bearophile:I understand the girl is a researcher. They, especially if they are PhD students, have very strict deadlines, and have milestones to do. Finally, they in most cases work ALONE. With all due respect, but I find it disrespectful to criticise immediately the implementation, especially if it is something pretty serious. Finally, such critic, pull request, suggestion, whatever, should be directed *to the author herself*, or on project's mailing list, bugtrack, etc instead of posting here. Don't you agree?Dejan Lekic:If only most companies I worked for cared about it, or for that matter unit tests. :(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
Feb 04 2013
On Monday, 4 February 2013 at 23:02:04 UTC, MattCoder wrote:On Monday, 4 February 2013 at 20:08:32 UTC, Paulo Pinto wrote:I absolutely agree.Am 04.02.2013 20:16, schrieb Dejan Lekic:I agree too. But one thing that I saw is we should getting happy to see another project using D, but the focus went to her code instead! Let's take easy, and be glad that she is promoting D. And by the way, the project looks awesome!Paulo Pinto wrote:100%Am 03.02.2013 19:58, schrieb bearophile:I understand the girl is a researcher. They, especially if they are PhD students, have very strict deadlines, and have milestones to do. Finally, they in most cases work ALONE. With all due respect, but I find it disrespectful to criticise immediately the implementation, especially if it is something pretty serious. Finally, such critic, pull request, suggestion, whatever, should be directed *to the author herself*, or on project's mailing list, bugtrack, etc instead of posting here. Don't you agree?Dejan Lekic:If only most companies I worked for cared about it, or for that matter unit tests. :(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
Feb 05 2013
On 02/05/2013 05:17 AM, Dejan Lekic wrote:On Monday, 4 February 2013 at 23:02:04 UTC, MattCoder wrote:I don't, but that's because I hate JavaScript only slightly less than PHP or Python and want to see all of them die. -- Matthew Caron, Software Build Engineer Sixnet, a Red Lion business | www.sixnet.com +1 (518) 877-5173 x138 officeAnd by the way, the project looks awesome!I absolutely agree.
Feb 05 2013
On 2013-02-05 18:24, Matthew Caron wrote:On 02/05/2013 05:17 AM, Dejan Lekic wrote:I have similar feelings regarding PHP and Javascript. Not sure why you'd hate Python (except the obvious: indents, GIL). Nevertheless I hope one day I'll be able to replace Python with D in most cases.On Monday, 4 February 2013 at 23:02:04 UTC, MattCoder wrote:I don't, but that's because I hate JavaScript only slightly less than PHP or Python and want to see all of them die.And by the way, the project looks awesome!I absolutely agree.
Feb 05 2013
On 02/05/2013 12:54 PM, FG wrote:On 2013-02-05 18:24, Matthew Caron wrote:I have a rule - any language which does not have a method by which one can force variable predeclaration is a toy and not suitable for real work. Perl's "use strict" is an example of this. I've spent too long chasing data going off into the ether because I typoed a variable name in an assignment. -- Matthew Caron, Software Build Engineer Sixnet, a Red Lion business | www.sixnet.com +1 (518) 877-5173 x138 officeI don't, but that's because I hate JavaScript only slightly less than PHP or Python and want to see all of them die.I have similar feelings regarding PHP and Javascript. Not sure why you'd hate Python (except the obvious: indents, GIL). Nevertheless I hope one day I'll be able to replace Python with D in most cases.
Feb 05 2013
On 2/5/2013 10:57 AM, Matthew Caron wrote:I have a rule - any language which does not have a method by which one can force variable predeclaration is a toy and not suitable for real work.Yeah, autodeclaration is one of those things that gets regularly "invented" by newbies who think the rest of us are idiots for not having thought of it!
Feb 05 2013
Walter Bright:Yeah, autodeclaration is one of those things that gets regularly "invented" by newbies who think the rest of us are idiots for not having thought of it!Still, I prefer to use Python in many situations, like when I design a new algorithm, because it decreases the amount of brain I have to put on the language, freeing more brain to think about the actual problem. Python is a very well designed language. Bye, bearophile
Feb 05 2013
On 02/05/2013 09:01 PM, bearophile wrote:Walter Bright:See, I use D for that these days - then I port it to C if there's no D cross compiler for the platform I'm using. -- Matthew Caron, Software Build Engineer Sixnet, a Red Lion business | www.sixnet.com +1 (518) 877-5173 x138 officeYeah, autodeclaration is one of those things that gets regularly "invented" by newbies who think the rest of us are idiots for not having thought of it!Still, I prefer to use Python in many situations, like when I design a new algorithm, because it decreases the amount of brain I have to put on the language, freeing more brain to think about the actual problem. Python is a very well designed language.
Feb 06 2013
On 02/03/2013 01:58 PM, bearophile wrote:Dejan Lekic:Which is very difficult when attempting to bootstrap a new language into a company, to say nothing of working on some random project. I have that issue at work now - code is reviewed by C programmers, so they won't be able to compare one D idiom to another because they're not aware of either of them. -- Matthew Caron, Software Build Engineer Sixnet, a Red Lion business | www.sixnet.com +1 (518) 877-5173 x138 officeIn 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
Feb 05 2013
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.
Feb 03 2013
Am 03.02.2013 22:05, schrieb Peter Alexander:On Sunday, 3 February 2013 at 18:24:05 UTC, Dejan Lekic wrote:Specially in offshore projects....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.
Feb 03 2013
On Sunday, 3 February 2013 at 21:05:57 UTC, Peter Alexander wrote:On Sunday, 3 February 2013 at 18:24:05 UTC, Dejan Lekic wrote:Good points. In the case at hand, the researcher is likely not expecting to re-use the code or maintain it past the projects termination point, so it's most likely a quick and dirty job. In fact she mentions that no attempts were made to optimize for performance because it's a proof of concept, which suggests throw away code. BTW, I've been digging away on D for a few months now, and have written a fair amount of D code, yet I still have not explored all of the languages features and even after I've looked at everything it's very likely I will not use all of the available features because it's very likely not all of it will add enough value, and may even complicate matters in practice more than it promises to simplify in theory. --rtWelcome 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.
Feb 04 2013
It would be nice to know why she choose D. Possibly the reason is because she wanted to write code quickly, which is one of the advantages that D is supposed to provide over some other languages. --rt
Feb 04 2013
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.
Feb 03 2013
On Sunday, 3 February 2013 at 20:54:29 UTC, Nick Sabalausky wrote: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?There is no range or function calls! That syntax existed well before ranges were even conceived. It is nothing more than shorthand for the obvious for-loop alternative.
Feb 03 2013
Nick Sabalausky:Why is it silly? (Genuine question)"Silly" wasn't the right word, sorry. But generally if a language offers you a clean feature (D contract programming is designed clean enough) it's better to use it, when you clearly need it. In D you can live without D contract programming, but is useful, and it's better to know it. (I'd also like Phobos to replace most of its usages of enforce() with asserts inside contracts.) Bye, bearophile
Feb 03 2013
On Sunday, 3 February 2013 at 22:00:05 UTC, bearophile wrote:Nick Sabalausky:I don't use D contracts, even though I use asserts. I find that adding contracts bloats my code quite a lot, making it less readable. real log(real x) in { assert(x > 0); } body { return ...; } v.s. real log(real x) { assert(x > 0); return ...; } As far as I'm aware there is no difference except when inheritance is involved, so it's an easy choice for me.Why is it silly? (Genuine question)"Silly" wasn't the right word, sorry. But generally if a language offers you a clean feature (D contract programming is designed clean enough) it's better to use it, when you clearly need it.
Feb 03 2013
Peter Alexander:I don't use D contracts, even though I use asserts. I find that adding contracts bloats my code quite a lot, making it less readable. real log(real x) in { assert(x > 0); } body { return ...; } v.s. real log(real x) { assert(x > 0); return ...; } As far as I'm aware there is no difference except when inheritance is involved, so it's an easy choice for me.If you have to create some temporary values (or to perform some computation) for your asserts you probably want to put this code inside a {} to avoid such names to spill inside the body of the function. There are also post-conditions, that catch all the returns you have in your function, unlike free asserts. There are also loop invariants, missing in D contract programming: http://d.puremagic.com/issues/show_bug.cgi?id=9300 Also, a well designed language enforces pre and post conditions to not mutate values (this is an ongoing discussion in D: http://d.puremagic.com/issues/show_bug.cgi?id=9408 ), and offers you the "old" (prestate) feature only inside contracts (missing still in D contract programming). Contracts also make life a little simpler for static analysis tools (that aren't yet available in D). So the better contract programming is implemented in a language (and its tools), the more useful it is compared to using free asserts. Bye, bearophile
Feb 03 2013
On 02/03/2013 11:14 PM, Peter Alexander wrote:On Sunday, 3 February 2013 at 22:00:05 UTC, bearophile wrote:If the code is written consistently in this vertically-bloated style, it is 'less readable' anyway. Contracts will not make a huge difference. :o)Nick Sabalausky:I don't use D contracts, even though I use asserts. I find that adding contracts bloats my code quite a lot, making it less readable. real log(real x) in { assert(x > 0); } body { return ...; }Why is it silly? (Genuine question)"Silly" wasn't the right word, sorry. But generally if a language offers you a clean feature (D contract programming is designed clean enough) it's better to use it, when you clearly need it.v.s. real log(real x) { assert(x > 0); return ...; }real log(real x) in{ assert(x > 0); }body{ return ...; } real log(real x) in{ assert(x > 0); }body{ return ...; }As far as I'm aware there is no difference except when inheritance is involved, so it's an easy choice for me.The difference is that the first version of log given above may be correct whereas the second is certainly buggy (pass in 0 and it fails). As correctness is not necessarily modular, the entire code base as a unit may still work correctly if it contains either version. That's why your approach is practicable in the absence of a tool/review process that checks assertions in a modular way.
Feb 03 2013
Best code, it's which works and the client is satisfied.
Feb 03 2013
On Sun, 03 Feb 2013 22:15:09 +0100 "Michael" <pr m1xa.com> wrote:Best code, it's which works and the client is satisfied.And the end users are satisfied. AND doesn't cause problems when it inevitably needs maintenance. And isn't prone to crapping out or breaches of security.
Feb 03 2013
Nick Sabalausky wrote:On Sun, 03 Feb 2013 22:15:09 +0100 "Michael" <pr m1xa.com> wrote:AND you expect that from ONE, single person who is implementing something like Higgs? :) Come on, be realistic... -- Dejan Lekic dejan.lekic (a) gmail.com http://dejan.lekic.orgBest code, it's which works and the client is satisfied.And the end users are satisfied. AND doesn't cause problems when it inevitably needs maintenance. And isn't prone to crapping out or breaches of security.
Feb 04 2013
On Monday, 4 February 2013 at 19:19:06 UTC, Dejan Lekic wrote:Nick Sabalausky wrote:Yes, you are right. But it's all is just nuances ))) P.S.: For completeness ;)On Sun, 03 Feb 2013 22:15:09 +0100 "Michael" <pr m1xa.com> wrote:AND you expect that from ONE, single person who is implementing something like Higgs? :) Come on, be realistic...Best code, it's which works and the client is satisfied.And the end users are satisfied. AND doesn't cause problems when it inevitably needs maintenance. And isn't prone to crapping out or breaches of security.
Feb 04 2013
On Mon, 04 Feb 2013 19:19 +0000 Dejan Lekic <dejan.lekic gmail.com> wrote:Nick Sabalausky wrote:Just to be clear, I was replying to the comment about what qualifies as "best" code. I never said anything about *expecting* anything.On Sun, 03 Feb 2013 22:15:09 +0100 "Michael" <pr m1xa.com> wrote:AND you expect that from ONE, single person who is implementing something like Higgs? :) Come on, be realistic...Best code, it's which works and the client is satisfied.And the end users are satisfied. AND doesn't cause problems when it inevitably needs maintenance. And isn't prone to crapping out or breaches of security.
Feb 09 2013
On 02/03/2013 08:56 AM, bearophile wrote:text() is shorter than to!string(),In all fairness, I wasn't aware of text until this comment, so perhaps the author was not either? For the curious, I found docs here, since I now knew what I was looking for: -- Matthew Caron, Software Build Engineer Sixnet, a Red Lion business | www.sixnet.com +1 (518) 877-5173 x138 office
Feb 05 2013
On 2013-02-05 18:21, Matthew Caron wrote:In all fairness, I wasn't aware of text until this comment, so perhaps the author was not either?There are still many examples around with to!string, so it's easy not to notice text() if you are like me and stop looking after you found something that works. :) In previous version of Phobos text(...) is used 168 and to!string 181 times, and in 2.061 DMD release the proportions are rather similar.
Feb 05 2013
On 2/5/13 1:04 PM, FG wrote:On 2013-02-05 18:21, Matthew Caron wrote:Care for a shotgun search/replace pull request? AndreiIn all fairness, I wasn't aware of text until this comment, so perhaps the author was not either?There are still many examples around with to!string, so it's easy not to notice text() if you are like me and stop looking after you found something that works. :) In previous version of Phobos text(...) is used 168 and to!string 181 times, and in 2.061 DMD release the proportions are rather similar.
Feb 05 2013
I prefer to!string to text() because you can use the same to!T pattern for a great many types T. text is something I use more only when I want to do multiple arguments together.
Feb 05 2013
05-Feb-2013 22:59, Adam D. Ruppe пишет:I prefer to!string to text() because you can use the same to!T pattern for a great many types T.wtext, dtexttext is something I use more only when I want to do multiple arguments together.Actually me too, to!string feels more explicit. -- Dmitry Olshansky
Feb 05 2013
On Tuesday, 5 February 2013 at 19:02:19 UTC, Dmitry Olshansky wrote:wtext, dtextto!int, etc too
Feb 05 2013
On 2/5/2013 11:10 AM, Adam D. Ruppe wrote:On Tuesday, 5 February 2013 at 19:02:19 UTC, Dmitry Olshansky wrote:toto too!wtext, dtextto!int, etc too
Feb 05 2013
On 02/05/2013 10:59 AM, Adam D. Ruppe wrote:I prefer to!string to text() because you can use the same to!T pattern for a great many types T.+1 Ali
Feb 05 2013
On 2/5/13, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:Care for a shotgun search/replace pull request?Looking at the implementation: string text(T...)(T args) { return textImpl!string(args); } private S textImpl(S, U...)(U args) { S result; foreach (i, arg; args) { result ~= to!S(args[i]); } return result; } I can see 2 optimizations here: 1. Use a static if to replace the append operator with a simple return when there's only one argument 2. Use Appender instead of a regular string for multiple arguments. it to be safe, but Appender isn't safe.
Feb 05 2013
05-Feb-2013 23:01, Andrej Mitrovic пишет:On 2/5/13, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:Time to make Appender trusted and linch the author if it's not that safe inside? ;) But seriously it would silently allow system OutputRanges... trusted needs re-design. -- Dmitry OlshanskyCare for a shotgun search/replace pull request?Looking at the implementation: string text(T...)(T args) { return textImpl!string(args); } private S textImpl(S, U...)(U args) { S result; foreach (i, arg; args) { result ~= to!S(args[i]); } return result; } I can see 2 optimizations here: 1. Use a static if to replace the append operator with a simple return when there's only one argument 2. Use Appender instead of a regular string for multiple arguments. it to be safe, but Appender isn't safe.
Feb 05 2013
On Sunday, 3 February 2013 at 13:56:13 UTC, bearophile wrote:deadalnix:I faced memory corruption in out contract and invariants in the past. So I can't really blame people that don't want to run into such trouble.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.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.
Feb 05 2013
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
Feb 03 2013
As she noted in its journal, maybe she give a keynote talk at DConf 2013. Additionaly, I think it would be great to take an interview with her.
Feb 06 2013