Pg-Basic
repl.it
repl.it
> I wrote this yesterday as an example for my kids.
> A lot of people learned how to make web pages using view->source. Replit is view->source for code, plus a server you can run a copy on. A generation of kids will learn to program from it.
Undergraduates at mid-tier schools are already using it nearly exclusively for their lower-level coursework. And mainly by word-of-mouth. While I've seen all the students using it to essentially do code reviews, I haven't seen any professors mention it to their classes.
It would be useful to have private repl's for students, as it's a technically a looming academic integrity issue to have most student's repl's public[0]. I understand this is potentially a breaking change for your freemium model, but there's a bit of a time bomb waiting there. Whether it's a tempest in a teapot or a "real" problem, and for whom, is debatable.
For my coursework, all C++ code must be complied with a .replit file containing:
> run = "g++ main.cpp -Wall -Wextra -std=c++11 -o a.out && ./a.out"
> language = "c++"
This is because everything is "turned in" on ZyBooks, which uses these options.
It's very, very cool that you let us change the compiler+options using either a .replit file or directly compile and run from the repl.run command line. However, most of my peers never discovered that the repl.run command line was interactive -- and certainly didn't find the .replit file feature. As a result, some moved away from repl.it mid-semester (generally migrating permanently to CLion) because clang "fixes" too many errors for them and things would "work" on repl.it but not on ZyBooks where it matters. For this reason I think there's potentially some use in putting a compiler/compile option inside each repl's side navbar's setting button menu. If this doesn't seem appropriate (for example because repl's in many language don't need to change compiler/options), then I'd recommend at least putting a link there to an explanation on .replit files for better discoverability.
Speaking of ZyBooks, I think the Repl.it company could compete well in the educational space. In particular, I think OpenStax would be a good organization to get in touch with, depending on how it fits your financial model / philosophy. Most broadly though I find there is an incredible lack of rigorous application of the _science of teaching_ in online learning solutions, dating back to Khan Academy and affecting every online learning platform since. Here's an example of what I'm talking about [1]. The linked video is somewhat long/boring and very low production quality --- but I hope the concepts in the content stick with anyone who works in edu-tech. I'm often very surprised that given the budgets of companies like Khan Academy, Udacity, etc that I don't see strong evidence they used a small portion of the money to consult with an expert who specializes in techniques and science of teaching.
Lastly, (at least as of 8 weeks ago) when the repl.run console is broken out into a separate window (great for multi-monitor displays!), it did not display segfault error messages in the break-out console. This happens with any red-colored text in the repl.run window - it displays in the primary editing window's console, but does not display in the broken out standalone repl.run console window. It was very difficult to determine why my code wasn't outputting anything after a certain point, but also was not throwing any errors :)
For example:
int main(void)
{
main();
return 0;
}Case A: Using g++ via .replit in main window (same .replit file as shown above in this post) ('exit status 139' is printed in red):
> g++ main.cpp -Wall -Wextra -std=c++11 -o a.out && ./a.out
Segmentation fault (core dumped)
exit status 139
>
Case B: Same setup as Case A, but reviewing output shown in the repl.run break-out tab/window: (there is no red 'exit status 139' output)
> Segmentation fault (core dumped)
Case C: Using g++ directly in repl.run console in main window (also no 'exit status 139'):
> g++ main.cpp -Wall -Wextra -std=c++11 -o a.out && ./a.out
Segmentation fault (core dumped)
>
Case D: Using clang in main window ('exited, segmentation fault' appears in red text):
> clang++-7 -pthread -std=c++17 -o main main.cpp
> ./main
exited, segmentation fault
>
Case E: Using clang in repl.run breakout tab/window ('exited, segmentation fault' does not appear at all, in fact nothing appears):
>
Lastly, I'm sure this is asking for the moon, but eventually it would be incredible to have debugging tools in the development environment (step through, current values of variables, and maybe memory inspection) - this applies to nearly every language you currently support. More specifically to C++, some people may also enjoy having features similar to those found at https://godbolt.org/ although I'd imagine that's a very niche group of people at the moment. You're serving a very wide audience as it is.
My classmates are extremely impressed with the quality of repl.it - the deep feature set does not seem to have compromised usability at all. My classmates are also very impressed with your 'careers' page, I would keep that up for engineering roles as you grow, if not necessarily also for non-technical administrative roles.
0: https://www.google.com/search?q=site%3Arepl.it+COSC
1: https://www.youtube.com/watch?time_continue=15&v=hC0MV843_Ng...
Try it here: https://repl.it/l/basic
Docs: https://docs.repl.it/misc/basic
Interpreter source code: https://repl.it/@amasad/pg-basic
PG's tweet: https://twitter.com/paulg/status/1256526589300441093
However, we realized that we can do a much better job on syntax and other features. So in collaboration with PG, we're evolving the language to make it more expressive and cleaner without losing the magic that makes Basic a great introductory programming language.
I've been trying to do Pyxel (via repl.it) with my kids. They really like coding that draws things, and I really appreciate how easy it is to get started. Downside is that some of the syntax is a bit confusing. Kids have a hard time with whitespace for indent, and the Pyxel draw loop is not really intuitive for them. I'll try out this Basic interpreter to see if it's a bit better for them.
The IDE is built on top of a window-tiling manager abstraction we built in React.js: https://blog.repl.it/ide
Now, as for languages, most of them do run inside the container, which is built from our base image polygott (https://github.com/replit/polygott). However, a select-few are better suited to run on the client. We have a client-side jail called: replbox (https://github.com/replit/replbox). Basic, for example, runs on replbox because I wanted to graphics to be instant. For something like PyGame or LOVE frameworks we had to go with VNC streaming but that's not ideal for obvious network reasons.
There is a lot more to it -- it sometimes feels like building an entire city -- and you can find some more posts on our blog: https://blog.repl.it/ (which incidentally is hosted on Repl.it).
Aside from celebrity tweets, what is your process for adding support for a new language? I've observed, for example, that Repl.it wraps some open-source interpreters like ngn/apl and JS-Forth.
We wrote about the process it takes to add a language here: https://blog.repl.it/elisp
But also, since we announced `.replit` which allows you to configure the run button you can pretty much build your own environment without waiting for us to support it natively: https://docs.repl.it/repls/dot-replit
What are you looking to add?
I'm the author of a JS-based K implementation[0], and ngn has another which is implemented in C[1]. Many of my projects involve making browser-based development environments or compilers in one form or another[2].
[0] http://johnearnest.github.io/ok/index.html
(That said, teaching kids using Scratch, which doesn't give them any real idea at all of how important syntax and spelling is, nor how computers normally make loops and subroutines, isn't all that great either.)
Here is the same program with no line numbers: https://repl.it/@paulgraham/repeat-nolines
Quickbasic itself was a refined version of 1980s Basics, it removed line numbers in favor of optional line labels and featured structured programming constructs like the SUB/FUNCTION statements. The IDE was an early rich development environment akin to Eclipse or Netbeans, which would do realtime syntax checking and allow the user to navigate code semi-visually (by listing functions in a dialog).
All the while, Quickbasic had a "standard library" of sorts that made drawing graphics and playing (PC speaker) sounds relatively accessible for the beginner programmer.
It still had its rough edges (string manipulation was godawful), so a straight port of Quickbasic idioms probably isn't in order, but as far as refining Basic to be a bridge between beginner and advanced, I still feel like it never quite had a proper successor.
https://github.com/skx/gobasic
I also added a simple HTTP-server, with a <textarea> inside it for writing your program. I figured that server should be called "visual basic" since it allowed you to plot graphs, etc ;)
I felt like my kids would miss out on this experience of random programming.
repl.it is a nice substitute though. Maybe I'll just pull out an old computer and force it to boot into repl.it...
I think this is a great step between Scratch and something like Python.
The classroom/assignment feature [i] is absolutely brilliant! Also, now might be a great time to do another [ii] hackathon.
[i] https://docs.repl.it/classrooms/intro
[ii] https://repl.it/talk/announcements/Massively_Multiplayer_Hac...
Did you click Run?
10 cls
20 print chr(2 + rnd(2) * 45);
40 goto 20
https://repl.it/@gabrielsroka/amazingDocumentation - https://docs.repl.it/
Repl.it evaluation server - https://github.com/replit/polygott
Universal interpreter for REPL - https://github.com/replit/prybar
Client-side protocol - https://github.com/replit/crosis
Evaluation sandbox - https://github.com/replit/replbox