I totally agree.Kingdaro wrote:I love Lua's simplicity, so I wouldn't really change anything about it. The only thing I truly want is assignment operators. This is annoying:This is less annoying:Code: Select all
self.longVariable = self.longVariable + 1
Code: Select all
self.longVariable += 1
If you were to create a programming language...
- baconhawka7x
- Party member
- Posts: 494
- Joined: Mon Nov 21, 2011 7:05 am
- Location: Oregon, USA
- Contact:
Re: If you were to create a programming language...
- sashwoopwoop
- Prole
- Posts: 8
- Joined: Fri Jun 27, 2014 10:53 am
Re: If you were to create a programming language...
And zero-based table indizes. Please.Kingdaro wrote:I love Lua's simplicity, so I wouldn't really change anything about it. The only thing I truly want is assignment operators. This is annoying:This is less annoying:Code: Select all
self.longVariable = self.longVariable + 1
Code: Select all
self.longVariable += 1
Re: If you were to create a programming language...
This I disagree with. I like the way Lua does it. Although unorthodox and not mindful of how memory management works, it's more humanistic and just makes more sense in general.sashwoopwoop wrote:And zero-based table indizes. Please.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: If you were to create a programming language...
Everytime i want to wrap something:Kingdaro wrote:This I disagree with. I like the way Lua does it. Although unorthodox and not mindful of how memory management works, it's more humanistic and just makes more sense in general.sashwoopwoop wrote:And zero-based table indizes. Please.
Code: Select all
i = ((i + 1 - 1) % N) + 1 -- or more concisely: i = ( i % N) + 1
i = ((i - 1 - 1) % N) + 1 -- or: i = ((i - 2) % N) + 1
Code: Select all
i = (i + 1) % N
i = (i - 1) % N
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- soulaymenc
- Prole
- Posts: 36
- Joined: Thu Jul 11, 2013 2:03 pm
- Contact:
Re: If you were to create a programming language...
Thank you for starting this awesome subject!
As a software, web and game developer, I would say that Lua is an awesome programming language, but have many weak points.
The programming language that I'm going to write for sure will look similar to lua, but much less dangerous. What's dangerous about Lua is that you might not know what you are manipulating. Variables could contain different kind of data and you need to make sure you are passing the right variables in the right parameters. I think that static typing in programming language is a feature. Lua syntax is very simple and comfortable. I would use pretty much same syntax but with different style since I'll be adding types, something like:
I wrote a language which was kinda similar in C, but i fucked things up so I had to rewrite it, and I'm just being lazy
As a software, web and game developer, I would say that Lua is an awesome programming language, but have many weak points.
The programming language that I'm going to write for sure will look similar to lua, but much less dangerous. What's dangerous about Lua is that you might not know what you are manipulating. Variables could contain different kind of data and you need to make sure you are passing the right variables in the right parameters. I think that static typing in programming language is a feature. Lua syntax is very simple and comfortable. I would use pretty much same syntax but with different style since I'll be adding types, something like:
Code: Select all
let update = function( dt: Int )
#Check objects
for i, v in ipairs(objects) do
if v.health == 0 then
objects.remove v
end
end
end
This world is so strange.
Re: If you were to create a programming language...
Lots of things are functions rather than built-in features to allow power and would have some nice syntactic sugar to hide this. For example, an if statement might look like this:
But 'if' is a function. For example, an 'equivalent' Lua thing would be like
Obviously the raw if would have to be implemented in the host language, but you could then overwrite 'if' to do weird things if you want. Flexible. Dangerous. I like it.
Code: Select all
if(blahblah == 'hi'){
whatever
}
Code: Select all
local function decide(cond,func)
if cond then
func()
end
end
"your actions cause me to infer your ego is the size of three houses" -finley
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: If you were to create a programming language...
If you use Church Booleans then the definition of "if" becomes something like:
Code: Select all
function ifelse(cond, thenpart, elsepart)
return cond(thenpart, elsepart)
end
Help us help you: attach a .love.
Re: If you were to create a programming language...
I'm currently reading Practical LISP, and pretty much LISP does just that, where you can redefine the whole language if you want. And you're pretty much expected to.Obviously the raw if would have to be implemented in the host language, but you could then overwrite 'if' to do weird things if you want. Flexible. Dangerous. I like it.
It's weird, the more I read about old languages, the more I find they've plugged up most of the problems I have with modern languages.
Re: If you were to create a programming language...
- Static types, no implicit variable declaration.
- Require local or global, no implicit scope at variable declaration time.
- No syntactic sugar (except maybe the comfortable increment operators Lua lacks)
Re: If you were to create a programming language...
That's part of my inspiration for that; I just want a friendlier looking syntax. In Lisp, code and data are the same. However, I want code to look like code, not data, and Lisp doesn't solve that problem for me.Plu wrote:I'm currently reading Practical LISP, and pretty much LISP does just that, where you can redefine the whole language if you want. And you're pretty much expected to.Obviously the raw if would have to be implemented in the host language, but you could then overwrite 'if' to do weird things if you want. Flexible. Dangerous. I like it.
It's weird, the more I read about old languages, the more I find they've plugged up most of the problems I have with modern languages.
"your actions cause me to infer your ego is the size of three houses" -finley
Who is online
Users browsing this forum: Bing [Bot] and 3 guests