The only change I proposed in my above post that didn't happen was the comma didn't get ditched.
What do you mean? Where did you propose to ditch the comma?
The only change I proposed in my above post that didn't happen was the comma didn't get ditched.
What do you mean? Where did you propose to ditch the comma?
I really dislike the
syntax... I'd much rather something that looked more likeCode:[object methodNameAndArgument1Name:argument1 argumentName2:argument2]
Code:object.methodName([b]argument1Name:argument1 argumentName2:argument2[/b])
That would be a lot less jarring for people coming from C++, Java, Python, and related languages. The biggest difference to other languages is there's no commas between arguments, and argument names and their values are separated with a colon (as in Obj-C currently) rather than an equals (as in Python when using key word arguments... Java and C++ both lack this concept currently).
let anotherPoint = (2, 0)
switch anotherPoint {
case (let x, 0):
println("on the x-axis with an x value of \(x)")
case (0, let y):
println("on the y-axis with a y value of \(y)")
case let (x, y):
println("somewhere else at (\(x), \(y))")
}
let yetAnotherPoint = (1, -1)
switch yetAnotherPoint {
case let (x, y) where x == y:
println("(\(x), \(y)) is on the line x == y")
case let (x, y) where x == -y:
println("(\(x), \(y)) is on the line x == -y")
case let (x, y):
println("(\(x), \(y)) is just some arbitrary point")
}
I doubt it. Apple is pretty open with their development of things like Clang, so I don't think they'd surprise us with an all new language at WWDC.
But if they want to...
I'd love it if the whole language became more unified feeling. Right now all the freaking @ signs just to signal that the following code is Obj-C code is obnoxious.
String building is annoying. Why can't we just add strings like in Java or Python, or like << in C++?
Needs namespaces (name collisions, while rare, are super obnoxious and difficult to discover and debug).
Needs a package manager (I'd love it if they added a marketplace full of carefully curated Obj-C frameworks and libraries that we could buy and sell and review and pop right into our projects - but that's a change to Xcode / the whole developer program, not to the language).
Generators, iterators, dictionary and array comprehension... that'd all be sweet.
I really dislike the
[object methodNameAndArgument1Name:argument1 argumentName2:argument2]
syntax... I'd much rather something that looked more like object.methodName(argument1Name:argument1 argumentName2:argument2)
That would be a lot less jarring for people coming from C++, Java, Python, and related languages. The biggest difference to other languages is there's no commas between arguments, and argument names and their values are separated with a colon (as in Obj-C currently) rather than an equals (as in Python when using key word arguments... Java and C++ both lack this concept currently). Plus it would change []s as exclusively meaning that something is being indexed into and make dot syntax look less... weirdly out of place.
Further, I'd love the ability to have argument names be optional and to make arguments themselves be optional. This would require making it possible to set default arguments.
I'd love to introduce contracts that can be checked at compile time into the language. IE, better type checking and checking for null. It would cut down on run time error handling... or worse, not detecting/handling errors at all. You could also have contracts that guarantee a certain complexity class for a function, for example. See the "Typed Racket" language for more contract ideas (I love union types and the various niceties produced by that...)
Do away with having the programmer type out imports and includes lines. Those are dumb. The compiler should be able to run through the code, determine that it doesn't know what something is within its current scope and attempt to expand that scope on its own through trying different imports and includes and whatnot until it is able to resolve it - namespaces should help the compiler with this. If no matter what it does, it can't resolve the variable, only at that point should it fail compilation and think that the user has a typo.
And... I think that's all of the ideas I have right now. I've basically just described all of the major things I'd like for my own programming language that I'd like to implement someyear when I have the resources (i.e., time, money) for such pursuits.
Programming is not a weekend, "i wanna get rich" thing.
Tell that to Flappy Bird! $50,000/daily in advertising sure seems like a "get rich in a day" thing.
Hell, even tell that to Angry Birds, Cut the Rope, Candy Crush, etc. Those became rich virtually overnight.
Tell that to Flappy Bird! $50,000/daily in advertising sure seems like a "get rich in a day" thing.
Hell, even tell that to Angry Birds, Cut the Rope, Candy Crush, etc. Those became rich virtually overnight.
!!!!!!!!!!!!! There's more! This actually looks like something I don't think I've ever seen any other language capable of handling:
Code:let yetAnotherPoint = (1, -1) switch yetAnotherPoint { case let (x, y) where x == y: println("(\(x), \(y)) is on the line x == y") case let (x, y) where x == -y: println("(\(x), \(y)) is on the line x == -y") case let (x, y): println("(\(x), \(y)) is just some arbitrary point") }
F# can do this. They are called "match expressions":
http://msdn.microsoft.com/en-gb/library/dd233242.aspx
None of those examples actually demonstrate what I got excited about, namely the "x == y" portion. Not saying that F# can't do it, but their examples don't demonstrate if it can see relations between the variables being matched.
val yetAnotherPoint = (1, -1)
yetAnotherPoint match {
case (x, y) if x == y => println(s"($x, $y) is on the line x == y")
case (x, y) if x == -y => println(s"($x, $y) is on the line x == -y")
case (x, y) => println(s"($x, $y) is just some arbitrary point")
}
None of those examples actually demonstrate what I got excited about, namely the "x == y" portion. Not saying that F# can't do it, but their examples don't demonstrate if it can see relations between the variables being matched.
let function1 x =
match x with
| (var1, var2) when var1 > var2 -> printfn "%d is greater than %d" var1 var2
| (var1, var2) when var1 < var2 -> printfn "%d is less than %d" var1 var2
| (var1, var2) -> printfn "%d equals %d" var1 var2
I doubt it. Apple is pretty open with their development of things like Clang, so I don't think they'd surprise us with an all new language at WWDC.
But if they want to...
I'd love it if the whole language became more unified feeling. Right now all the freaking @ signs just to signal that the following code is Obj-C code is obnoxious.
String building is annoying. Why can't we just add strings like in Java or Python, or like << in C++?
Needs namespaces (name collisions, while rare, are super obnoxious and difficult to discover and debug).
Needs a package manager (I'd love it if they added a marketplace full of carefully curated Obj-C frameworks and libraries that we could buy and sell and review and pop right into our projects - but that's a change to Xcode / the whole developer program, not to the language).
Generators, iterators, dictionary and array comprehension... that'd all be sweet.
I really dislike the
[object methodNameAndArgument1Name:argument1 argumentName2:argument2]
syntax... I'd much rather something that looked more like object.methodName(argument1Name:argument1 argumentName2:argument2)
That would be a lot less jarring for people coming from C++, Java, Python, and related languages. The biggest difference to other languages is there's no commas between arguments, and argument names and their values are separated with a colon (as in Obj-C currently) rather than an equals (as in Python when using key word arguments... Java and C++ both lack this concept currently). Plus it would change []s as exclusively meaning that something is being indexed into and make dot syntax look less... weirdly out of place.
Further, I'd love the ability to have argument names be optional and to make arguments themselves be optional. This would require making it possible to set default arguments.
I'd love to introduce contracts that can be checked at compile time into the language. IE, better type checking and checking for null. It would cut down on run time error handling... or worse, not detecting/handling errors at all. You could also have contracts that guarantee a certain complexity class for a function, for example. See the "Typed Racket" language for more contract ideas (I love union types and the various niceties produced by that...)
Do away with having the programmer type out imports and includes lines. Those are dumb. The compiler should be able to run through the code, determine that it doesn't know what something is within its current scope and attempt to expand that scope on its own through trying different imports and includes and whatnot until it is able to resolve it - namespaces should help the compiler with this. If no matter what it does, it can't resolve the variable, only at that point should it fail compilation and think that the user has a typo.
And... I think that's all of the ideas I have right now. I've basically just described all of the major things I'd like for my own programming language that I'd like to implement someyear when I have the resources (i.e., time, money) for such pursuits.