TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: A modern BASIC-like teaching and learning programming language

76 点作者 chkas大约 5 年前

13 条评论

beagle3大约 5 年前
This is awesome - I just started looking for something like this, for my kid.<p>Having taught programming before, one thing that many people find confusing at first is using &quot;=&quot; for both assignment and equality; statements like &quot;x = x + 1&quot; make no sense as a math equation.<p>I think supporting (but not requiring) &quot;let&quot; (or equivalently &quot;make&quot; or &quot;set&quot;) helps go over that hump, although I last taught basic to someone 30 years ago... e.g., if you accept<p><pre><code> let a = 3 </code></pre> or<p><pre><code> make a = 3 </code></pre> makes it a little easier to grok<p><pre><code> let x = x + 1 </code></pre> (although the x on the left is &quot;now&quot; and the x on the right is &quot;before&quot;). Alternatively, using something like &quot;x &lt;- x + 1&quot; is much clearer, and just as clear for &quot;x &lt;- 3&quot; (especially with a right font or glyph). Unfortunately, there is no single ascii character&#x2F;glyph that intuitively conveys assignment; K uses &#x27;:&#x27; which is ok, Pascal uses &#x27;:=&#x27;, neither of which is good for Basic and the like, I think.
评论 #22843208 未加载
评论 #22843354 未加载
评论 #22842503 未加载
azhenley大约 5 年前
Nice timing. Last week I made a very simple BASIC compiler to show my undergrad students how to make a compiler: <a href="https:&#x2F;&#x2F;github.com&#x2F;AZHenley&#x2F;teenytinycompiler" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AZHenley&#x2F;teenytinycompiler</a><p>The write-up is coming in a few days.
评论 #22842966 未加载
ggambetta大约 5 年前
Love this! Reminds me of my first attempts at programming on a ZX Spectrum when I was 5 or so.<p>It&#x27;s hard to beat the simplicity and immediacy of writing a few lines of code and having a simple physics simulation (the bouncing ball example here). I can see this being extremely popular and useful to kids!
评论 #22842306 未加载
评论 #22842149 未加载
thewebcount大约 5 年前
This is a great idea!<p>I wonder, though, if it would be easier if you avoided computerese in your naming? Keywords like &quot;func&quot;, &quot;subr&quot;, and &quot;str_chars&quot; are part of what makes people&#x27;s heads spin when they first look at code. If they were just named &quot;function&quot;, and &quot;subroutine&quot;, and &quot;character_string&quot; (or just &quot;string&quot; or &quot;characters&quot;) it would be a little harder to type, but much much easier to read. And you know what they say – you&#x27;ll read a lot more code than you write.<p>Other than that, this looks really nice. Nice work!
评论 #22842535 未加载
DeathArrow大约 5 年前
This reminds me of Logo: <a href="https:&#x2F;&#x2F;turtleacademy.com&#x2F;&#x2F;lessons" rel="nofollow">https:&#x2F;&#x2F;turtleacademy.com&#x2F;&#x2F;lessons</a> Logo was invented in 1967
评论 #22842760 未加载
评论 #22842652 未加载
评论 #22844130 未加载
WoodenChair大约 5 年前
This is very similar to a Mac app I created called SeaTurtle—seems a mesh between BASIC and Logo brings back a kind of nostalgia in people who want to teach programming to kids that learned it in the &#x27;80s: <a href="https:&#x2F;&#x2F;oaksnow.com&#x2F;seaturtle&#x2F;" rel="nofollow">https:&#x2F;&#x2F;oaksnow.com&#x2F;seaturtle&#x2F;</a>
erehweb大约 5 年前
What&#x27;s the advantage of this over BASIC?
aldanor大约 5 年前
Just tried it out, here&#x27;s a little program that plots a fractal: <a href="https:&#x2F;&#x2F;bit.ly&#x2F;3a5MfaV" rel="nofollow">https:&#x2F;&#x2F;bit.ly&#x2F;3a5MfaV</a> (shortened the url since it&#x27;s quite long containing all the code)<p>Few comments:<p>- It would be nice to have a proper full reference of the language (maybe it exists but I couldn&#x27;t find it), with all details put together in one document. I had to dig through tons of tutorials just to see how floats are defined.<p>- How do you add comments in the code?...<p>- The editor removes empty lines - so if you try to separate logical blocks&#x2F;paragraphs you can&#x27;t do it. This coupled with lack of comment support hurts code readability. Maybe it could collapse &gt;1 empty lines to just 1 empty line inside.<p>- Defining floats: if you have a program that deals with both floats and has int-based for loops, you can&#x27;t use &quot;floatvars&quot; if I understand correctly. Now, having to add &quot;#&quot; as a suffix for each float variable greatly hurts readability since you now have lines like &quot;z# = x# * x# + y# * y#&quot;<p>- Editor - tries to be too smart at times which hurts basic editing functionality like undo; if I add a line and type something, the cmd-z doesn&#x27;t remove that line, it only removes text in the line. Also, if I type something syntactically wrong, the editor first tries to format&#x2F;transform the code and only then shows an error but doesn&#x27;t then return the code to what it looked like; this makes it hard to fix errors.<p>- Re: editor, why just not use a mature engine like CodeMirror? (and add your own syntax highlighting &#x2F; hints, etc)<p>- Why all those &quot;.&quot; instead of &quot;end&quot; in loops&#x2F;ifs inside functions? This is not explained anywhere and looks a bit obscure in tutorials<p>- Color system with 000-999: a lot of boilerplate to deal with it, troublesome to create palettes and it&#x27;s only 10 bits of color. Might be helpful to have a color function that takes three separate ints (or even floats 0.0-1.0, opengl-style).<p>But generally, kudos, good job :)
评论 #22844173 未加载
olav大约 5 年前
Nice! I love the re-invention of Logo-like textual languages. Just a few days ago I came across MOOSE language, used by Amy Bruckman in her online community. A lost art it seems.
ape4大约 5 年前
Not sure I would use `print` if I was redesigning it. But, of course, its ingrained in countless languages.
评论 #22843495 未加载
评论 #22859448 未加载
_curious_大约 5 年前
Neat, thanks for making &amp; sharing!
severak_cz大约 5 年前
looks like modern version of Logo programming language.
评论 #22843341 未加载
mjbrusso大约 5 年前
What about compile to LLVM bitcode?
评论 #22843357 未加载