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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Gravity: An embeddable programming language without any external dependencies

161 点作者 marcobambini将近 5 年前

15 条评论

creatornator将近 5 年前
I had the pleasure of contributing to Gravity a few years ago. I added builtin filter, map, reduce, reverse, and sort functions and tests to the array types. Marco was very receptive to my additions, and it felt very welcoming to newcomers. I learned a lot about different internal workings of interpreters making those contributions.
astatine将近 5 年前
I imagine this would be an alternative where embedded Lua gets used. A comparison with Lua would have been great to see. The 200K runtime, for example, indicates that this might weigh in somewhat heavier than Lua.
评论 #23469274 未加载
评论 #23467759 未加载
评论 #23468642 未加载
评论 #23468206 未加载
huhtenberg将近 5 年前
Slightly off-topic, but that's one beautifully done website.
评论 #23469835 未加载
评论 #23468737 未加载
评论 #23471772 未加载
评论 #23469445 未加载
dang将近 5 年前
See also from 2018: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17373545" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17373545</a>
ivoras将近 5 年前
&gt; Gravity has been developed from scratch for the Creo project in order to offer an easy way to write portable code for the iOS and Android platforms.<p>... so, now we CAN have scriptable &#x2F; interpreted code in iOS?
评论 #23470429 未加载
评论 #23472352 未加载
a-nikolaev将近 5 年前
The documentation says:<p>&gt; Closures are self-contained blocks of functionality that can be passed around and used in your code. Closures can capture and store references to any constants and variables from the context in which they are defined. Closures can be nested and can be anonymous (without a name)<p>I think, the term &quot;closure&quot; gains some unnecessary semantic meaning of a block of code &#x2F; anonymous function. I might be wrong, but It is better to think about it as simply a technique for implementing lexical scoping.<p>In other words, &quot;lexical scoping&quot; is a property of a language, while &quot;closure&quot; is only an implementation detail to make lexical scoping work. So the term closure does not have to leak in the description and semantics of the language itself. What is your opinion?<p>Edit: I just think that such proliferation of terminology confuses people, making them ask questions like: &quot;What is the difference between 1) function, 2) anonymous function, 3) lambda function, 4) closure?&quot; Instead, focusing on the idea of a function (possibly without a name) + lexical scoping clarifies everything immediately.
评论 #23469232 未加载
nurettin将近 5 年前
&gt;Features &gt;multipass compiler<p>irony is that this used to be a negative thing back in pascal days.
评论 #23469149 未加载
mkchoi212将近 5 年前
After having looked at it for a minute, it looks like a very simplified version of Swift. Looks great! Might try out the language on my Raspberry Pi and see how fast the thing is :p
评论 #23472333 未加载
thickbiscuit将近 5 年前
How do you import a library?
评论 #23468955 未加载
fra将近 5 年前
Has anybody tried compiling this for an embedded target (e.g. Cortex-M4, arm-none-eabi)?
ctas将近 5 年前
Did anyone use Gravity before and make a comment about the ecosystem &#x2F; community growth perspective?
评论 #23470178 未加载
vmchale将近 5 年前
Cool stuff! Thanks for sharing.
Koshkin将近 5 年前
I am disappointed to see yet another language suffer from the same old semicolon cancer.
评论 #23468991 未加载
评论 #23468837 未加载
评论 #23469123 未加载
blacksqr将近 5 年前
The first thing I want to know about a new language is its performance. Then I can start thinking meaningfully about the tradeoffs of using it compared to other languages.
评论 #23467848 未加载
评论 #23469089 未加载
gutino将近 5 年前
The fact that it sets null to uninitialized variables is mindblowing for lang created within the past 5 years. We all have learned that there &quot;null&quot; is there just to create bugs.<p>Please Consider creating a Gravity 2.0 with this fixed as a compile error, you will save a lot of debugging time to your users.
评论 #23468181 未加载
评论 #23468140 未加载
评论 #23468153 未加载
评论 #23472385 未加载
评论 #23471055 未加载