digitalmars.D - dlang.org live examples
- nazriel (26/26) Jun 25 2012 Hi!
- Kevin (17/42) Jun 25 2012 What I am picturing is having the code samples just like we do now with
- nazriel (16/86) Jun 25 2012 Hmm, pop-up approach isn't that bad, but IMHO it isn't too
- Andrea Fontana (4/30) Jun 25 2012 Why don't you split horizontally? Left: source, Right input (not
- nazriel (6/46) Jun 25 2012 I wanted to keep as much as possible old look of dlang.org code
- David Gileadi (4/8) Jun 25 2012 My opinion is that the fields should be hidden until the code is run for...
- Kevin (6/15) Jun 25 2012 That's essentially what I was getting at. Show the meaning like we do
- mta`chrono (5/5) Jun 25 2012 Hey,
- nazriel (17/24) Jun 25 2012 When you click Run button on dlang.dzfl.pl, ajax makes POST
- mta`chrono (5/7) Jun 26 2012 Oh cool. That's great!
- nazriel (18/26) Jun 26 2012 Actually it is:
- mta`chrono (2/2) Jun 26 2012 That's crazy shit yeha xD... and php and load balancer do communication
- nazriel (2/5) Jun 27 2012 Yeap, via TCP sockets.
- Iain Buclaw (5/33) Jun 27 2012 What happened to GDC and LDC compiler options? ;~)
- nazriel (11/58) Jun 27 2012 I want to try to release http://dpaste.dzfl.pl beta soon and
- nazriel (17/24) Jun 25 2012 When you click Run button on dlang.dzfl.pl, ajax makes POST
- Robik (7/33) Jun 25 2012 I think, that we should allow user to specify arguments whenever
- Jesse Phillips (3/9) Jun 25 2012 FYI: Someone somewhere has that up on their demo site. Don't know
- David Nadlinger (3/5) Jun 25 2012 You mean Adam Ruppe's take on executable code snippets?
- Jesse Phillips (2/7) Jun 25 2012 Yeah, that would be the one. It allows for editing too though.
- nazriel (5/18) Jun 26 2012 Nice! Any links?
Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask you about your opinions and advises. There are couple things I can't make my mind on. First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion? Another thing are examples itself. As you may noticed I modified some of em too give some experience in browser, for example, I've added writeln blocks in Power section. What should we do with 'em? Examples to run properly requires main functions, and loads of examples doesn't have them. Should we adjust those examples or leave them alone? Another thing are examples that doesn't return or display anything. Like assert(foo !is null); examples. Should we make them throw, add some writelns or leave them alone? I would love to hear your opinion on those. Best regards, Damian 'nazriel' Ziemba
Jun 25 2012
On 25/06/12 10:43, nazriel wrote:Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask you about your opinions and advises. There are couple things I can't make my mind on. First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their ow=n?It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion? Another thing are examples itself. As you may noticed I modified some of em too give some experience in browser, for example, I've added writeln blocks in Power section. What should we do with 'em? Examples to run properly requires main functions, and loads of examples doesn't have them. Should we adjust those examples or leave them alone? Another thing are examples that doesn't return or display anything. Like assert(foo !is null); examples. Should we make them throw, add some writelns or leave them alone? I would love to hear your opinion on those. Best regards, Damian 'nazriel' ZiembaWhat I am picturing is having the code samples just like we do now with a little "Try It!" button in the corner. When you click it it pops up a full version with all of the necessary wrapping and lets you run it and mess around. For the stdin I would have a little pane that can slide out. This might be a little more javascript than you were imagining but I could help you with that if you want. This way you keep it pretty while providing a full-featured environment. Also, have you considered using the ideone api to save yourself all of the security issues or is there something wrong with what they provide? I don't think that people are going to run every sample and this is why I think it is better to hide most of the features and I don't think people will mind the small delay that another tab or javascript window takes to open. Kevin
Jun 25 2012
On Monday, 25 June 2012 at 14:59:35 UTC, Kevin wrote:On 25/06/12 10:43, nazriel wrote:Hmm, pop-up approach isn't that bad, but IMHO it isn't too professional approach in now-days. Popups are also IMHO quite annoying and ugly. But of course thank you for suggestion! In overall I wanted to keep things simple, as you see, not much changed excluding adding 2 buttons, and line numbers on left-side (which anyways, can be disabled, well, also example itself can be edited :p) About security, that isn't an issue. Examples uses http://dpaste.dzfl.pl/ API to run them. Dpaste service itself cares about security. Why not use IDEONE? They have really outdated D compiler and I don't have possibility to change anything in it. For example I've added Command Line arguments to http://dpaste.dzlf.pl to allow smooth run of some examples (like word-count) and I can change/add anything at anytime while examples may requires something.Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask you about your opinions and advises. There are couple things I can't make my mind on. First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion? Another thing are examples itself. As you may noticed I modified some of em too give some experience in browser, for example, I've added writeln blocks in Power section. What should we do with 'em? Examples to run properly requires main functions, and loads of examples doesn't have them. Should we adjust those examples or leave them alone? Another thing are examples that doesn't return or display anything. Like assert(foo !is null); examples. Should we make them throw, add some writelns or leave them alone? I would love to hear your opinion on those. Best regards, Damian 'nazriel' ZiembaWhat I am picturing is having the code samples just like we do now with a little "Try It!" button in the corner. When you click it it pops up a full version with all of the necessary wrapping and lets you run it and mess around. For the stdin I would have a little pane that can slide out. This might be a little more javascript than you were imagining but I could help you with that if you want. This way you keep it pretty while providing a full-featured environment. Also, have you considered using the ideone api to save yourself all of the security issues or is there something wrong with what they provide? I don't think that people are going to run every sample and this is why I think it is better to hide most of the features and I don't think people will mind the small delay that another tab or javascript window takes to open. Kevin
Jun 25 2012
Why don't you split horizontally? Left: source, Right input (not hidden!) + output. In code there's a typo: "souce" instead of "source" On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote:Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask you about your opinions and advises. There are couple things I can't make my mind on. First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion? Another thing are examples itself. As you may noticed I modified some of em too give some experience in browser, for example, I've added writeln blocks in Power section. What should we do with 'em? Examples to run properly requires main functions, and loads of examples doesn't have them. Should we adjust those examples or leave them alone? Another thing are examples that doesn't return or display anything. Like assert(foo !is null); examples. Should we make them throw, add some writelns or leave them alone? I would love to hear your opinion on those. Best regards, Damian 'nazriel' Ziemba
Jun 25 2012
On Monday, 25 June 2012 at 15:03:20 UTC, Andrea Fontana wrote:Why don't you split horizontally? Left: source, Right input (not hidden!) + output. In code there's a typo: "souce" instead of "source" On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote:I wanted to keep as much as possible old look of dlang.org code snippets. That's why I didn't splited it horizontally.Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask you about your opinions and advises. There are couple things I can't make my mind on. First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion? Another thing are examples itself. As you may noticed I modified some of em too give some experience in browser, for example, I've added writeln blocks in Power section. What should we do with 'em? Examples to run properly requires main functions, and loads of examples doesn't have them. Should we adjust those examples or leave them alone? Another thing are examples that doesn't return or display anything. Like assert(foo !is null); examples. Should we make them throw, add some writelns or leave them alone? I would love to hear your opinion on those. Best regards, Damian 'nazriel' ZiembaIn code there's a typo: "souce" instead of "source"Ach, that's only placeholder to show all kinds of output the applet gives, but still thanks for info. Will fix it
Jun 25 2012
On 6/25/12 7:43 AM, nazriel wrote:First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion?My opinion is that the fields should be hidden until the code is run for the first time, at which point at least standard input should become visible for altering in subsequent runs.
Jun 25 2012
On Mon 25 Jun 2012 12:46:27 EDT, David Gileadi wrote:On 6/25/12 7:43 AM, nazriel wrote:That's essentially what I was getting at. Show the meaning like we do now and then have an "Edit Me!" button that shows the full sample and standard input/output. And if the examples are full programs it would be nice to have automated tests so that they are up-to-date with the compiler.First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion?My opinion is that the fields should be hidden until the code is run for the first time, at which point at least standard input should become visible for altering in subsequent runs.
Jun 25 2012
Hey, that's quite cool what you did! how did you do that? do you use fastcgi or cgi? how do you execute your code? inside some chroot environment or some other kind of virtual maschine. mta`chrono
Jun 25 2012
On Monday, 25 June 2012 at 19:27:13 UTC, mta`chrono wrote:Hey, that's quite cool what you did! how did you do that? do you use fastcgi or cgi? how do you execute your code? inside some chroot environment or some other kind of virtual maschine. mta`chronoWhen you click Run button on dlang.dzfl.pl, ajax makes POST request to local process.php (can be any scripting language, probably making it js-only could work with some iframes-hacking). Then it requests http://dpaste.dzfl.pl API via POST and it returns JSON with response. http://dpaste.dzfl.pl service resides on unaffected server, while compiler service resides on 4 (hope to add more mirrors in near future) machines. I've implemented small load balancer in D. Whole infrastructure is written in D and uses different approaches, containers on linux mirrors and jails on freebsd mirrors. Each request has limited resources, execution time, IO access etc. Website itself (http://dpaste.dzfl.pl) is written in PHP, but I am thinking about switching to D in near future (not sure what framework pick up yet, vibe.d, serenity or own implementation). If you want to know more details, let me know
Jun 25 2012
Am 25.06.2012 22:25, schrieb nazriel:If you want to know more details, let me knowOh cool. That's great! textarea -> JSON -> AJAX -> PHP Script -> ....... -> Load Balancer -> Chroot jail -> D Compiler. How do you perform interation between php and you load balancer?
Jun 26 2012
On Tuesday, 26 June 2012 at 15:02:14 UTC, mta`chrono wrote:Am 25.06.2012 22:25, schrieb nazriel:Actually it is: textarea -> Ajax -> PHP Script -> JSON -> http://dpaste.dzfl.pl -> Load Balancer -> Target Jail -> JSON back to http://dpaste.dzfl.pl -> JSON -> PHP Script -> Your output window :D Load balancer has list of available mirrors, it randomizes this list and in foreach loop tries to connect to host, if it success it just returns, otherwise it continues until it success. When Chroot Jail, has too many connections OR resources for Compiler infrastructure are out, its just cut outs socket connection, so balancer goes forwards and connects to another one. Here you can see it in action: http://dpaste.dzfl.pl/66612383 Copy example, create new paste and click couple of times "Compile". I have Linux and FreeBSD mirrors so its showes how requests are forwardedIf you want to know more details, let me knowOh cool. That's great! textarea -> JSON -> AJAX -> PHP Script -> ....... -> Load Balancer -> Chroot jail -> D Compiler. How do you perform interation between php and you load balancer?
Jun 26 2012
That's crazy shit yeha xD... and php and load balancer do communication via TCP/UNIX socket? some kind of protocol?
Jun 26 2012
On Wednesday, 27 June 2012 at 00:11:05 UTC, mta`chrono wrote:That's crazy shit yeha xD... and php and load balancer do communication via TCP/UNIX socket? some kind of protocol?Yeap, via TCP sockets.
Jun 27 2012
On 26 June 2012 16:55, nazriel <damian dzfl.pl> wrote:On Tuesday, 26 June 2012 at 15:02:14 UTC, mta`chrono wrote:What happened to GDC and LDC compiler options? ;~) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';Am 25.06.2012 22:25, schrieb nazriel:Actually it is: textarea -> Ajax -> PHP Script -> JSON -> http://dpaste.dzfl.pl -> Load Balancer -> Target Jail -> JSON back to http://dpaste.dzfl.pl -> JSON -> PHP Script -> Your output window :D Load balancer has list of available mirrors, it randomizes this list and in foreach loop tries to connect to host, if it success it just returns, otherwise it continues until it success. When Chroot Jail, has too many connections OR resources for Compiler infrastructure are out, its just cut outs socket connection, so balancer goes forwards and connects to another one. Here you can see it in action: http://dpaste.dzfl.pl/66612383 Copy example, create new paste and click couple of times "Compile". I have Linux and FreeBSD mirrors so its showes how requests are forwardedIf you want to know more details, let me knowOh cool. That's great! textarea -> JSON -> AJAX -> PHP Script -> ....... -> Load Balancer -> Chroot jail -> D Compiler. How do you perform interation between php and you load balancer?
Jun 27 2012
On Wednesday, 27 June 2012 at 13:44:43 UTC, Iain Buclaw wrote:On 26 June 2012 16:55, nazriel <damian dzfl.pl> wrote:I want to try to release http://dpaste.dzfl.pl beta soon and officially announce service, while GDC and LDC requires some more work from me (mainly writing scripts for automatic building). I really would love to see ready binaries for Debian (Linux in overall) and FreeBSD but probably won't happen :p Not sure why, but I have small problems with building both, GDC and LDC on FreeBSD, both on my server and local vm. In short words: So as for now, I removed them from list. But they will be back.On Tuesday, 26 June 2012 at 15:02:14 UTC, mta`chrono wrote:What happened to GDC and LDC compiler options? ;~)Am 25.06.2012 22:25, schrieb nazriel:Actually it is: textarea -> Ajax -> PHP Script -> JSON -> http://dpaste.dzfl.pl -> Load Balancer -> Target Jail -> JSON back to http://dpaste.dzfl.pl -> JSON -> PHP Script -> Your output window :D Load balancer has list of available mirrors, it randomizes this list and in foreach loop tries to connect to host, if it success it just returns, otherwise it continues until it success. When Chroot Jail, has too many connections OR resources for Compiler infrastructure are out, its just cut outs socket connection, so balancer goes forwards and connects to another one. Here you can see it in action: http://dpaste.dzfl.pl/66612383 Copy example, create new paste and click couple of times "Compile". I have Linux and FreeBSD mirrors so its showes how requests are forwardedIf you want to know more details, let me knowOh cool. That's great! textarea -> JSON -> AJAX -> PHP Script -> ....... -> Load Balancer -> Chroot jail -> D Compiler. How do you perform interation between php and you load balancer?
Jun 27 2012
On Monday, 25 June 2012 at 19:27:13 UTC, mta`chrono wrote:Hey, that's quite cool what you did! how did you do that? do you use fastcgi or cgi? how do you execute your code? inside some chroot environment or some other kind of virtual maschine. mta`chronoWhen you click Run button on dlang.dzfl.pl, ajax makes POST request to local process.php (can be any scripting language, probably making it js-only could work with some iframes-hacking). Then it requests http://dpaste.dzfl.pl API via POST and it returns JSON with response. http://dpaste.dzfl.pl service resides on unaffected server, while compiler service resides on 4 (hope to add more mirrors in near future) machines. I've implemented small load balancer in D. Whole infrastructure is written in D and uses different approaches, containers on linux mirrors and jails on freebsd mirrors. Each request has limited resources, execution time, IO access etc. Website itself (http://dpaste.dzfl.pl) is written in PHP, but I am thinking about switching to D in near future (not sure what framework pick up yet, vibe.d, serenity or own implementation). If you want to know more details, let me know
Jun 25 2012
On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote:Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask you about your opinions and advises. There are couple things I can't make my mind on. First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion?I think, that we should allow user to specify arguments whenever it is possible and reasonable.Another thing are examples itself. As you may noticed I modified some of em too give some experience in browser, for example, I've added writeln blocks in Power section. What should we do with 'em? Examples to run properly requires main functions, and loads of examples doesn't have them. Should we adjust those examples or leave them alone? Another thing are examples that doesn't return or display anything. Like assert(foo !is null); examples. Should we make them throw, add some writelns or leave them alone? I would love to hear your opinion on those.I would go with adjusting them, to make output cleaner. Idea to replace assert(...) with writeln() sounds good.Best regards, Damian 'nazriel' ZiembaOverall, stuff you made is quite impressive, keep it going! Regards, Robik.
Jun 25 2012
On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote:Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ I would love to hear your opinion on those. Best regards, Damian 'nazriel' ZiembaFYI: Someone somewhere has that up on their demo site. Don't know why it hasn't been activated.
Jun 25 2012
On Monday, 25 June 2012 at 20:34:39 UTC, Jesse Phillips wrote:FYI: Someone somewhere has that up on their demo site. Don't know why it hasn't been activated.You mean Adam Ruppe's take on executable code snippets? David
Jun 25 2012
On Monday, 25 June 2012 at 21:26:01 UTC, David Nadlinger wrote:On Monday, 25 June 2012 at 20:34:39 UTC, Jesse Phillips wrote:Yeah, that would be the one. It allows for editing too though.FYI: Someone somewhere has that up on their demo site. Don't know why it hasn't been activated.You mean Adam Ruppe's take on executable code snippets? David
Jun 25 2012
On Monday, 25 June 2012 at 20:34:39 UTC, Jesse Phillips wrote:On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote:Nice! Any links? Well, to be honest, I was working mainly on http://dpaste.dzfl.pl but I was asked if I wanna integrate http://dlang.org with it, so here it is.Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ I would love to hear your opinion on those. Best regards, Damian 'nazriel' ZiembaFYI: Someone somewhere has that up on their demo site. Don't know why it hasn't been activated.
Jun 26 2012