I know someone who's making a game with Clickteam Fusion and considers it almost a form of betrayal to go with GameMaker. :-p So when I brought up GameMaker, I was thinking of mentioning Clickteam Fusion as well, but the usual cost is $99. I don't really know enough about it to know that it's worth that price tag. Now that it's on sale, I guess I'll be picking it up just in case I want to use it sometime, just like the other one.
I started using ansi-term in emacs to launch a shell file which wrapped rlwrap around the file I wished to execute. Turns out that M-x no longer works in that buffer.
Just echoing that rlwrap isn't needed. I actually added an arg (-n) to arc.sh that doesn't use rlwrap. I use it when running arc inside an emacs shell, because emacs has terminal integration that I prefer.
"But, unfortunately the language will be much more constrained if all services must consist of letters. I have an explicit goal that any service name goes except some very few reserved characters. The reason is that it should be possible to create DSL-like APIs with service names like "$", "&", "->", "+", or even "{" and ";"."
Yes, probably you are right here.
"As you have suggested, a solution for this could be to instead check if the service exist at all in the scope."
Yes, actually I thought of having all service names starting uppercase to check if a name is a service faster.
"Service names that do not exist can be assumed to be actions on the @ service. This is a more unconstrained solution. But it means that all actions on @ can never be used as service names."
I think you should be able to shadow @'s names, and then, if you need them, call them with the @.
"This makes a dilemma between unconstrained, small syntax and prettier code with quirky reserved words. Do you agree?"
I think that if you use the approach I just said (you can shadow the @'s names) you wont make your language more constrained. However, yes, you will add new syntax, which you consider a bad thing.
"Now for your other suggestion. Yes, I agree! I have thought about it before, and I think it might have no drawbacks. The fact that you also noticed it makes it even more probable that it is a good solution. The challenge will then be, as you also noticed, how a variable service can be the variable and the value at the same time.
I think it is not good enough to simply check if there are no actions on foo, because then foo must always be the last value. I.e. this has to work:"
Yes, it would not be an improvement.
"Can you explain more on how your other solution to this would work? I did not quite understand it."
Imagine a service which supports both int/number's actions and variable actions. You could write:
foo = 4
and it would call the variable action =. And here:
foo + 4
it would call the number action +.
However in this case:
4 + foo
things are more complicated. I looked at your "+" implementation, and it expects that it's argument is a js number. You can make a check, like if the argument isn't a number and it is a service, you try to call a getvalue action, and if it returns a number, you use it. Or maybe change something about accessing the value of an number (or string), but I don't know how services are implemented (yet), so I can't tell precisely.
That is a good idea. And it will make the code much prettier. Here is what I think the fibonacci example would look like:
var fibonacci :
var scope :
var result = (.argument)
.argument > 1 then
set result =
fibonacci (.result - 1) + (fibonacci (.result - 2))
.result
scope (.argument)
fibonacci 7
//result: 13
But, unfortunately the language will be much more constrained if all services must consist of letters. I have an explicit goal that any service name goes except some very few reserved characters. The reason is that it should be possible to create DSL-like APIs with service names like "$", "&", "->", "+", or even "{" and ";".
As you have suggested, a solution for this could be to instead check if the service exist at all in the scope. Service names that do not exist can be assumed to be actions on the @ service. This is a more unconstrained solution. But it means that all actions on @ can never be used as service names. This makes a dilemma between unconstrained, small syntax and prettier code with quirky reserved words. Do you agree?
Now for your other suggestion. Yes, I agree! I have thought about it before, and I think it might have no drawbacks. The fact that you also noticed it makes it even more probable that it is a good solution. The challenge will then be, as you also noticed, how a variable service can be the variable and the value at the same time.
I think it is not good enough to simply check if there are no actions on foo, because then foo must always be the last value. I.e. this has to work:
foo + 4
Can you explain more on how your other solution to this would work? I did not quite understand it.
By the way, if variable services could also represent their value, it should be very simple to implement some sort of lazy evaluation in the language. That would be cool.
Hmm, I'm surprised but this question seems to have never come up before over here. Google says the only mention of heroku in this forum is http://arclanguage.org/item?id=19394 which says one of the advantages of Clojure over Arc is that it can be hosted over Heroku.
Please report back if you have success doing so, or what problems you run into. Thanks!
Er, I upvoted your "sorry" just now because I did find it interesting that those archive links exist. :) I guess the Racket project doesn't have such tireless devotion to documentation that they maintain active versions of the docs for old software releases, but it's nice that a snapshot is up somewhere.
Many thanks for your pull request! Support for Windows chronically lags behind Unix, and I'd love to hear about any more bugs you run into on Windows.
rlwrap is just a little program which provides some standard features of Unix shells like commandline history and keyboard shortcuts. It's nice to have but certainly not essential.
Your examples are valid in Linux, but I was trying to launch anarki in Windows. So I've made windows batch file arc.cmd following arc.sh. Seems it works now. I have made a pull req to the repo.
...Only thing - how to port rlwrap to windows? And what (for what) is it? Better REPL formatting? :-)
I have an idea, but I'm not sure it's ok: Since @ is used most of the time, it could be the default.
To do that you might make a rule that all services must start with a capital letter(or a number or " or be "true" or be "false"), and only services can.
Then you can make:
foo bar baz
change to:
@ foo bar baz
while:
Foo bar baz
Remains the same. If you don't like the idea of every service starting uppercase, you could just check if the word is a service.
Now an unrelated issue, accessing and modifying a variable:
@ set foo = 4
Even if we ignore the @ (because it's a different problem):
set foo = 4
It would be better to write just:
foo = 4
And it makes sense: variable service foo, action =, argument 4.
Now accessing a variable:
4 + @.foo
I should be able to write:
4 + foo
This is a bit more complicated.
To allow the foo = 4 part foo must be a variable service.
But in this case it should act as a number service.
I see two ways to solve this: or variable services gain new actions based on their type,
or when a service is called without an action, a standard action is called, which by default returns the service itself, but can be overwritten, for example in variables, where it returns the variable value.
Thank you for taking the time to look at the language. Yes, I agree that there is a problem with a lot of @s and vars littering the code. A consequence of the small syntax seems to be that working with variables and scope is very verbose. My goal with the language is to keep the syntax very very small, but at the same time be able to express the typical things we expect from modern programming languages. Maybe some syntactic sugar could help. But I am not sure what kind of sugar would work best to avoid all the @s. Any ideas?
And yes, the documentation of system provided services is indeed lacking. I have made an issue for it and plan to address it asap: https://github.com/holgerl/hilvl/issues/9
This approach (everything is a service) has pros and cons: with it you can easily overload operators, and it gives you the ability to extend infix notation (while in programming languages with c syntax only the built in language operators have infix notation, and your functions have the functions(arg1,arg2,...) syntax). But hilvl is quite verbose. Usually arguments against static typing include the fact that typing the type name is verbose. In hilvl you have to type two words: @ and var. And to call a function (action) you have to always type the service. This leads to a lot of @, which isn't very good. If you look at the recursion example [1] you will see that every line starts with @. The other two examples, and the server code aren't much better. There should be a trick to have less @'s.
Apart from that, the absence of documentation isn't nice. I wanted to see the IO actions, and I had to find it's definition in the js source.
Thanks! I remember seeing it yesterday at 1 point and assuming it was done. Didn't notice when people started upvoting it. Oh well, probably too late now.
Finding better ways to write code that let newcomers make sense of them faster. More details: http://akkartik.name/about
The teaching fits into this in two ways:
a) It seems like a more ambitious test. If I can make codebases easier for non-programmers or inexperienced programmers to understand, then experienced ones should hopefully be easy.
b) It's a way to get feedback. It's hard to find experienced programmers willing to try out a strange new way of writing code that isn't going to be useful in real products for a very long time. Without this feedback I'd be likely to burn out long before I can fully validate or invalidate my hypothesis. But at least for me, teaching is extremely rewarding/addictive.
Oh, there's a third way: since I get paid for my teaching, there's the distant possibility that I might be able to scale up the teaching to fund my research so that I can work on it full-time.