digitalmars.D.announce - Server-Side magazine interview, touches on D
- Andrei Alexandrescu (2/2) Jan 29 2012 http://www.serversidemagazine.com/news/10-questions-with-facebook-resear...
- Andrei Alexandrescu (4/5) Jan 29 2012 Should have looked first, it's on reddit already. Please vote up :o).
- George Fekete (3/9) Jan 29 2012 :)
- Adam D. Ruppe (14/18) Jan 29 2012 That's very easy.
- Andrei Alexandrescu (3/19) Jan 29 2012 The difficult part is integrating with Apache.
- Adam D. Ruppe (28/29) Jan 29 2012 Eh, it's not so bad. Make a .htaccess file:
- Nick Sabalausky (23/24) Jan 29 2012 "we tried hard to make off-the-shelf tools work at the scale and quality...
- Jesse Phillips (4/6) Jan 30 2012 So the whole industry has moved away from php? Sure templating is
- Nick Sabalausky (9/15) Jan 30 2012 I wish! No, it's moved away from using PHP in an ASP-classic-style. Ie,
- Jacob Carlborg (5/10) Jan 30 2012 This is used in Rails as well. I mean, you need a way to get a value
- Nick Sabalausky (4/13) Jan 30 2012 Right, but that's the extent of it. It's used for the HTML templates and...
- Adam D. Ruppe (8/10) Jan 31 2012 Interestingly, a lot of PHP devs don't even use PHP for
- Jacob Carlborg (66/76) Jan 31 2012 It seems like Smarty is used mostly because of PHP being quite verbose.
- Walter Bright (2/3) Jan 29 2012 Nice, I enjoyed reading it.
- Caligo (3/5) Jan 29 2012 Learn how to learn? Could you elaborate, please? How did you learn
- Walter Bright (7/9) Jan 29 2012 I can't speak for Andrei, but I discovered after 4 years of university t...
- bearophile (6/12) Jan 29 2012 It's meta-learning (second order learning). There is a page on Wikipedia...
- Nick Sabalausky (6/12) Jan 29 2012 Bullshit, bullshit, bullshit. All you need to learn how to learn is a
- Bill Baxter (4/19) Jan 30 2012 or feedback on how well you are doing.
- Nick Sabalausky (12/38) Jan 30 2012 Having deadlines doesn't need to cost $100k.
http://www.serversidemagazine.com/news/10-questions-with-facebook-research-engineer-andrei-alexandrescu/ Andrei
Jan 29 2012
On 1/29/12 4:34 PM, Andrei Alexandrescu wrote:http://www.serversidemagazine.com/news/10-questions-with-facebook-research-engineer-andrei-alexandrescu/Should have looked first, it's on reddit already. Please vote up :o). http://www.reddit.com/r/programming/comments/p229i/10_questions_with_facebook_research_engineer/ Andrei
Jan 29 2012
On Sunday, 29 January 2012 at 22:35:32 UTC, Andrei Alexandrescu wrote:On 1/29/12 4:34 PM, Andrei Alexandrescu wrote::)http://www.serversidemagazine.com/news/10-questions-with-facebook-research-engineer-andrei-alexandrescu/Should have looked first, it's on reddit already. Please vote up :o). http://www.reddit.com/r/programming/comments/p229i/10_questions_with_facebook_research_engineer/ Andrei
Jan 29 2012
On Sunday, 29 January 2012 at 22:34:19 UTC, Andrei Alexandrescu wrote:I wish I’d convince a serious hacker to bring things to the point where <?d writeln("Hello, world!"); ?> could be inserted in a web page.That's very easy. About 100 lines of simple string manipulation makes it happen: http://arsdnet.net/dcode/dhp.d $ ./dhp hello <?d writef("%s", "andrei"); ?>! <press control d> hello andrei! $ Set up a shebang or htaccess rule or something like that, and boom, you have it on the web. But, I'd question the utility of it. I wrote that dhp.d script over a year ago, and have never actually used it.
Jan 29 2012
On 1/29/12 4:52 PM, Adam D. Ruppe wrote:On Sunday, 29 January 2012 at 22:34:19 UTC, Andrei Alexandrescu wrote:The difficult part is integrating with Apache. AndreiI wish I’d convince a serious hacker to bring things to the point where <?d writeln("Hello, world!"); ?> could be inserted in a web page.That's very easy. About 100 lines of simple string manipulation makes it happen: http://arsdnet.net/dcode/dhp.d $ ./dhp hello <?d writef("%s", "andrei"); ?>! <press control d> hello andrei! $ Set up a shebang or htaccess rule or something like that, and boom, you have it on the web. But, I'd question the utility of it. I wrote that dhp.d script over a year ago, and have never actually used it.
Jan 29 2012
On Monday, 30 January 2012 at 05:17:21 UTC, Andrei Alexandrescu wrote:The difficult part is integrating with Apache.Eh, it's not so bad. Make a .htaccess file: .htaccess: === Action dhp-script /cgi-bin/dhp AddHandler dhp-script .dhp === Drop in your files. hello.dhp === <?d cgi.write("Hello, world!"); ?> === NOTE: that is cgi.write, not writefln. This version uses my cgi library so you have all those awesomesauce functions. And in your cgi-bin folder, build dhp out of this file: http://arsdnet.net/dcode/dhp_cgi.d And drop my cgi.d into your /tmp directory. http://arsdnet.net/dcode/cgi.d End result? http://arsdnet.net/dhp/hello.dhp works. Of course, you'll see this is slow because it runs the compiler every time. If it used rdmd instead of dmd though, we'd get cache and it'd probably work pretty decently. (My computer doesn't have rdmd set up currently though.)
Jan 29 2012
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message news:jg4hhb$kll$1 digitalmars.com...http://www.serversidemagazine.com/news/10-questions-with-facebook-research-engineer-andrei-alexandrescu/"we tried hard to make off-the-shelf tools work at the scale and quality we need them to, failed, and had to write our own." Yea, I get tired very quickly of defending NiH. Anti-NiH sentiments soudns great in theory, but the rality is that most off-the-shelf software just plain sucks - *especially* off-the-shelf web software. "I wish I'd convince a serious hacker to bring things to the point where <?d writeln("Hello, world!"); ?> could be inserted in a web page." God no. You'll never convince a serious hacker to do that, becuase if you *could* convince them, they wouldn't be a very serious hacker to begin with. Web-front-end people learned a long time ago, from hard experience, that that's a terrible approach to server-side code on the web. No serious web software does that anymore, except maybe when limited to carefully-simplistic uses inside the "HTML templates" waaay off deep into the "view" section of MVC. The whole industry's moved over keeping server-side code out of the HTML, and using plain-old-code to drive an HTML-template presentation system (and that transition started as long as about ten years ago - My first taste of it was the [now old and mediocre] ASP.NET). I'd argue that, even better than that, we should be replacing the "HTML templates" with Adam's brilliant approach of "Server-side HTML DOM" (primarily limited to a presentation module, of course).
Jan 29 2012
On Sunday, 29 January 2012 at 23:25:36 UTC, Nick Sabalausky wrote:The whole industry's moved over keeping server-side code out of the HTMLSo the whole industry has moved away from php? Sure templating is used so mixing php and html is as common, but if I'm not mistaken <? is still ?> used a lot, I don't know how to use PHP without it.
Jan 30 2012
"Jesse Phillips" <jessekphillips+D gmail.com> wrote in message news:ictwgryawpavhnrnqawa dfeed.kimsufi.thecybershadow.net...On Sunday, 29 January 2012 at 23:25:36 UTC, Nick Sabalausky wrote:I wish! No, it's moved away from using PHP in an ASP-classic-style. Ie, scattering a bunch of <?php ... ?> throughout an HTML document.The whole industry's moved over keeping server-side code out of the HTMLSo the whole industry has moved away from php?Sure templating is used so mixing php and html is as common, but if I'm not mistaken <? is still ?> used a lot, I don't know how to use PHP without it.Typically now, a PHP file will start with "<?php" to turn on "PHP-mode", and then it'll just leave PHP-mode on for the rest of the file. It won't even be closed with "?>" - this ensures no stray whitespace is printed, which can screw things up (for instance, if you're expecting that HTTP headers are not to have been sent yet.)
Jan 30 2012
On 2012-01-30 23:51, Jesse Phillips wrote:On Sunday, 29 January 2012 at 23:25:36 UTC, Nick Sabalausky wrote:This is used in Rails as well. I mean, you need a way to get a value from the controller into the view. -- /Jacob CarlborgThe whole industry's moved over keeping server-side code out of the HTMLSo the whole industry has moved away from php? Sure templating is used so mixing php and html is as common, but if I'm not mistaken <? is still ?> used a lot, I don't know how to use PHP without it.
Jan 30 2012
"Jacob Carlborg" <doob me.com> wrote in message news:jg84d8$1ea5$1 digitalmars.com...On 2012-01-30 23:51, Jesse Phillips wrote:Right, but that's the extent of it. It's used for the HTML templates and not much else.On Sunday, 29 January 2012 at 23:25:36 UTC, Nick Sabalausky wrote:This is used in Rails as well. I mean, you need a way to get a value from the controller into the view.The whole industry's moved over keeping server-side code out of the HTMLSo the whole industry has moved away from php? Sure templating is used so mixing php and html is as common, but if I'm not mistaken <? is still ?> used a lot, I don't know how to use PHP without it.
Jan 30 2012
On Tuesday, 31 January 2012 at 07:14:48 UTC, Jacob Carlborg wrote:This is used in Rails as well. I mean, you need a way to get a value from the controller into the view.Interestingly, a lot of PHP devs don't even use PHP for this! There's stuff like smarty in fairly wide use: http://www.smarty.net/why_use Though, of course, many PHP devs *do* use php for their templates too. (including me when I do php w/o D. I like the {$foo.bar} syntax in smarty but not the rest of it.)
Jan 31 2012
On 2012-01-31 16:51, Adam D. Ruppe wrote:On Tuesday, 31 January 2012 at 07:14:48 UTC, Jacob Carlborg wrote:It seems like Smarty is used mostly because of PHP being quite verbose. This is not the case with Ruby and specially not with the help of the many view helpers the Rails framework provides out of the box. Note also that Rails provides many different template languages as plugins. There could well be a smarty plugin. Looking at the syntax comparisons: http://www.smarty.net/syntax_comparison Late's make a comparison with two Rails template languages, Erb (the default) and HAML. smarty: {$foo} erb: <%= foo > haml: = foo php: <?=$foo['bar']?> smarty: {$foo.bar} In Rails you would most likely pass an object instead of an array/hash. erb: <%= foo.bar > haml: = foo.bar If you actually do pass a hash it will like this: haml: = foo[:bar] Or you can implement "method_missing" (like opDispatch) in the Hash class and get this syntax: haml: = foo.bar smarty: {foreach $foo as $bar} {/foreach} erb: <% foo.each do |bar| %> <% end %> or <% for bar in foo %> <% end %> haml: - foo.each do |bar| smarty: {for $x = 1 to 20 step 2} {$x} {/for} haml: - (1 .. 20).step 2 do |x| = x {$foo|lower|escape} haml: =h foo.downcase To me it looks like HAML wins in every example. Don't know if Smarty has this feature but this is so cool in Rails: = render posts What happens is posts is an array of model objects of the type Post. Rails will look in the directory containing all view files for a directory called "posts". Then it will look for a partial named "_post.html.haml". It will render that partial passing in the element in the current iteration to the partial as "post". In Rails you are free to do whatever you want in the views (not sure if you can access everything you need). But you are encouraged to keep the Ruby code to a minimum. -- /Jacob CarlborgThis is used in Rails as well. I mean, you need a way to get a value from the controller into the view.Interestingly, a lot of PHP devs don't even use PHP for this! There's stuff like smarty in fairly wide use: http://www.smarty.net/why_use Though, of course, many PHP devs *do* use php for their templates too. (including me when I do php w/o D. I like the {$foo.bar} syntax in smarty but not the rest of it.)
Jan 31 2012
On 1/29/2012 2:34 PM, Andrei Alexandrescu wrote:http://www.serversidemagazine.com/news/10-questions-with-facebook-research-engineer-andrei-alexandrescu/Nice, I enjoyed reading it.
Jan 29 2012
2012/1/29 Andrei Alexandrescu <SeeWebsiteForEmail erdani.org>:http://www.serversidemagazine.com/news/10-questions-with-facebook-research-engineer-andrei-alexandrescu/ AndreiLearn how to learn? Could you elaborate, please? How did you learn how to learn?
Jan 29 2012
On 1/29/2012 6:16 PM, Caligo wrote:Learn how to learn? Could you elaborate, please? How did you learn how to learn?I can't speak for Andrei, but I discovered after 4 years of university that I had become much better at learning new things. I attribute it to becoming more efficient at what kinds of effort I needed to make to master new material - I knew what worked for me and what didn't. One also cannot help but get better at anticipating what kinds of things will be on the examinations, so that's what you focus on.
Jan 29 2012
Walter:On 1/29/2012 6:16 PM, Caligo wrote:It's meta-learning (second order learning). There is a page on Wikipedia, but it's too much short and its quality is too much low: http://en.wikipedia.org/wiki/Meta_learning I believe that learning how to learn better is probably the most important thing to learn at the University. If you get good enough at learning, then many other things in life become possible. There are situations were people change (learn) how they learn to learn (third order learning), but this is a bit psychologically painful (I have not found stuff on Wikipedia about this, so you need to search in primary sources, like books by Seymour Papert). Bye, bearophileLearn how to learn? Could you elaborate, please? How did you learn how to learn?I can't speak for Andrei, but I discovered after 4 years of university that I had become much better at learning new things.
Jan 29 2012
I can't speak for Andrei, but I discovered after 4 years of university that I had become much better at learning new things.I believe that learning how to learn better is probably the most important thing to learn at the University.Bullshit, bullshit, bullshit. All you need to learn how to learn is a library, not a $100k debt payable to useless pompous windbags. The biggest thing colleges teach is that their existence is actually needed for anything. And even *that* much is pure grade-A bullcrap. Yea, you *can* learn such things at college: just like how I can sell you a $5k device to help you convert ice into water.
Jan 29 2012
On Sun, Jan 29, 2012 at 10:35 PM, Nick Sabalausky <a a.a> wrote:or feedback on how well you are doing. Some people need that. --bbI can't speak for Andrei, but I discovered after 4 years of university that I had become much better at learning new things.I believe that learning how to learn better is probably the mostimportantthing to learn at the University.Bullshit, bullshit, bullshit. All you need to learn how to learn is a library, not a $100k debt payable to useless pompous windbags. The biggest thing colleges teach is that their existence is actually needed for anything. And even *that* much is pure grade-A bullcrap. Yea, you *can* learn such things at college: just like how I can sell you a $5k device to help you convert ice into water. Libraries don't give you deadlines (except for when to return your books)
Jan 30 2012
"Bill Baxter" <wbaxter gmail.com> wrote in message news:mailman.202.1327961928.25230.digitalmars-d-announce puremagic.com...On Sun, Jan 29, 2012 at 10:35 PM, Nick Sabalausky <a a.a> wrote:Having deadlines doesn't need to cost $100k.Libraries don't give you deadlines (except for when to return your books)I can't speak for Andrei, but I discovered after 4 years of university that I had become much better at learning new things.I believe that learning how to learn better is probably the mostimportantthing to learn at the University.Bullshit, bullshit, bullshit. All you need to learn how to learn is a library, not a $100k debt payable to useless pompous windbags. The biggest thing colleges teach is that their existence is actually needed for anything. And even *that* much is pure grade-A bullcrap. Yea, you *can* learn such things at college: just like how I can sell you a $5k device to help you convert ice into water.or feedback on how well you are doing.If you're relying on the tests to tell you how well you're doing, then you've already failed. *You* are by far the best person to know whether *you* understand something or not. A school's evaluation is *NOT* for the student's sake - it's purely for the school's/teacher's own accountability. It's inherently innacurate, but needed anyway simply because they can't read your mind for an "I understand" or "I don't get it" - but you *can* read your own mind, so for the student, test results are extra time, extra money and *less* accurate, all for no benefit.Some people need that.
Jan 30 2012