Earlier quoted context omitted.
The love2d community is definitely still active, especially on IRC. Some of the nicest folks I've ever spoken to over the internet. I can't recommend the language or its community highly enough.
A couple of friends just successfully launched a commercial game on android/ios/steam using love2d, and they're really happy with the results. I couldn't believe it was made with lua, it runs really smooth. http://midipixel.com/warlockstower/
MoonScript, a programmer friendly language that compiles to Lua
121–130 of 171 posts
Re: MoonScript, a programmer friendly language that compiles to Lua
#122Earlier quoted context omitted.
Except that arrays start on 1, right?
Exactly. It's more intuitive and you have less `x-1`'s in your code.
If you came up in assembly language and C, like me, you tend to think of array indices as offsets, and the first item obviously has an offset of 0. Anything else is absurd. If you came up in any number of environments that view collections like arrays from the standpoint of something like set theory, then the first (1st!) item clearly has an index of 1. What would a zeroeth item even mean?!. See---it's just point of view and familiarity.
I resisted Python for years because I just couldn't get past the clearly fragility and cognitive burden of something so mind-bogglingly stupid as meaningful whitespace. It took me a while to realize this was much more about me than about Python.
You bounce off of these contextual things all the time in Mathematics: Is 1 prime? Do the Whole numbers include 0? Etc., etc. The answer is---depends on who you ask and what you're working on. It can be implicit, especially to a community (like, say, users of a programming language), or it may need to be explicit to avoid confusion "In this house, we obey the Fundamental Theorem of Arithmetic! 1 is not prime!" As long as you get those particular ducks in a row, the problem is mostly just impedance from people mistaking their personal experience for natural law.
Re: MoonScript, a programmer friendly language that compiles to Lua
#123Earlier quoted context omitted.
Can you give us some examples of one-based algorithms? I've done a lot of programming in one-based languages, and now avoid such languages as much as possible (sometimes have no choice) because nothing seems to naturally fit into that.
any kind of numerical method (RKs, FDs, CN) where the n-th step a_n = f(a_(n-1)) and hence you define NUM_STEPS and the the result is a[NUM_STEPS] where a is your numerical lattice. you could work in a 0-based index and your n-th step is a_(n-1) and so the final step is a[NUM_STEPS - 1] in numerical analysis I don't believe i've ever cared that much about slicing. if i wanted to look at a single element in a matrix a…
For an iterative method, you have an initial value a[0], then take your NUM_STEPS steps, so the final result is a[NUM_STEPS]. If it's one-based, the final result is a[NUM_STEPS+1]. This type of thing trips up my Matlab (one-based) students all the time.
In zero-based linear algebra, the indices i and j start at 0, so the top left entry of a matrix is a[0, 0], the pivot element is a[i, j] and the pivot row is a[i, :]. There isn't any adjustment needed.
Finite differences, Simpson's Rule, etc., seem more natural with zero-based too. x_0 is the left-most value, x_n is the right-most value, and the interval is divided into n pieces.
Re: MoonScript, a programmer friendly language that compiles to Lua
#124Earlier quoted context omitted.
I have to say that if I see last update in changelog from few years ago I assume the project is dead and one should not use it.
You should disabuse yourself of this notion, a lot of mature projects don't get updates because they don't have (known) bugs or are feature complete.
Re: MoonScript, a programmer friendly language that compiles to Lua
#125Some of the stuff in Moonscript feels a little overdone and magical, like parens-less function calls and the syntactically significant whitespace - but others really feel like they're fixing the gaps in Lua. Moonscript's nice lambda syntax, ternary operator, default local, implicit return, etc. But I don't think I really needed the ! operator, for example.
fixing the gaps in Lua. Moonscript's [...] default local Roberto Ierusalimschy, the creator of Lua, believes that "Local by default is wrong." [1]. I don't necessarily agree that local-by-default is inherently wrong, but every implementation of local-by-default that I've seen has had flaws. It looks like MoonScript is no different - its scoping rules seem to suffer from the same "madness" as CoffeeScript [2]. [1] htt…
-- will print:
-- 15
-- 0
-- 15
-- 10
y = 0
goodfun = (x) ->
local y
y = 10
y + x
badfun = (x) ->
y = 10
y + x
print(goodfun(5))
print(y)
print(badfun(5))
print(y)Re: MoonScript, a programmer friendly language that compiles to Lua
#126Hey all, I made MoonScript about 6 years ago. I used it to build a ton of opensource stuff in addition to the company I founded. I use it every day and I'm very happy with how it's turned out. I regret not updating the language more frequently, but I've been busy building a bunch of stuff in it. The biggest open source project is a web framework for Open Resty: https://github.com/leafo/lapis It's used for the followi…
The font you are using looks broken to me. (Win 10, Firefox) At 100% scaling, every "i" clearly looks like a "1". It reads "MoonScr1pt" for me: https://i.imgur.com/Ti12E5I.png If I zoom in or out in the browser the i looks ok again.
Re: MoonScript, a programmer friendly language that compiles to Lua
#127I understand that people love programming in classes, but I really want something like a stripped-down ES6. In particular, I want: 1. Lists and objects/dicts only; objects have no prototypes at all; objects have no first-class methods, but they can have functions as member variables, and those functions can close over other data in the object 2. All function and variable declaration is anonymous (as a consequence of…
That actually wouldn't be hard to make; just use a custom eslint rules! If you want implicit returns and really want to disable "fancy features", babel plugins are fairly easy to create – blacklisting certain constructs wouldn't be very difficult, and implicit returns aren't so hard (you can copy my implementation[0] from a JS superset I built called LightScript[1]). EDIT: bonus of building on babel is that you can g…
Re: MoonScript, a programmer friendly language that compiles to Lua
#128Earlier quoted context omitted.
Moonscript uses local by default (compiles to Lua). Here is your code in Moonscript: foo = { x: {1, 2, 3}, y: (a, b, c) -> sum = a + b + c sum * sum }
Yeah, now just strip away all the other stuff and we'll be good.
Re: MoonScript, a programmer friendly language that compiles to Lua
#129Earlier quoted context omitted.
any kind of numerical method (RKs, FDs, CN) where the n-th step a_n = f(a_(n-1)) and hence you define NUM_STEPS and the the result is a[NUM_STEPS] where a is your numerical lattice. you could work in a 0-based index and your n-th step is a_(n-1) and so the final step is a[NUM_STEPS - 1] in numerical analysis I don't believe i've ever cared that much about slicing. if i wanted to look at a single element in a matrix a…
I don't really get your reasoning. For an iterative method, you have an initial value a[0], then take your NUM_STEPS steps, so the final result is a[NUM_STEPS]. If it's one-based, the final result is a[NUM_STEPS+1]. This type of thing trips up my Matlab (one-based) students all the time. In zero-based linear algebra, the indices i and j start at 0, so the top left entry of a matrix is a[0, 0], the pivot element is a[…
your matrix example is totally bizarre though. the top left of a matrix A is always A_(1,1). so not sure what a[0,0] means. a 1x1 matrix is always 1 element, which is a[1,1]. the number of elements in a mxn array is m*n.
Re: MoonScript, a programmer friendly language that compiles to Lua
#130I was on a team that used Lua in production on tens of thousands of machines running 24/7. The Lua interpreter was the weak link in the system, requiring at least daily restarts. Squashed so many bugs over the years, and still found more and more all the time. What I'm saying is, the Lua interpreter itself is flawed and I can't imagine using it as a runtime if I had the chance to avoid it. That said, the language was…
This page lists every known bug in the Lua interpreter for the last 14 years, along with its fix: https://www.lua.org/bugs.html The average is 8 bugs per year, most fairly obscure. Every Lua release fixes all known bugs. Roberto, the chief architect, is kind of fanatical about quality: https://www.youtube.com/watch?v=yU5QNKpATxk I do not believe the interpreter is as flawed as you claim.