Posts Tagged C

A language of my own

Today I was checking out an introduction video to CoffeeScript and it got me thinking about programming languages in general and where they were heading. The thing is, I think I would go in a different direction. Haha, that’s a pretty bold statement and I don’t know that many programming languages to be frank, but the last two I checked out, Python and Coffee Script didn’t have the same values that I think a future programming language should have.

You see if I look back in time ( with my time machine glasses) at first there was byte code, which was the summum of being cryptic, after that there was assembly code, which I manage to pass the class by acting as if I knew wtf it was meaning. C code was already more readable but still pretty hard to juggle with and I ended up with Java / ActionScript / C# which were the most readable in all the languages I had learned. When I say readable in all this I mean closer to the English language. That for me should be a primary value when creating a new language. I think the more readable a programming language is, the less barrier there is to creating code. You wouldn’t need to translate what you think into something else, you think, talk, write and program in the same language, that would be the best I think.

There is all lot of really easy thing we could do to turn Java into something already more readable without changing the syntax. Most of it would just be replacing shortcuts like for if statements “==” would be “is equal to” so

if (myCat == yourCat)

would become

if (myCat is equal to yourCat)

I mean this is a pretty simple example, but push this further and say we add a lot of these changes where we remove symbols like > < = ¬†/ ! || && and put words instead, I think it would make code really easy to read. I think that if it is easier to read, it is easier to grasp and if it is that way you can build more complex programs more easily. When all those simple swaps are done we could work on the syntax to make it more like English and then we would have a new programming language. I would like to reclaim the dot (“.”) to mark the end of a sentence like Latin languages.

So yeah I think we should create a new programming language where you have to write more code to get things done but that has less abstractions. That might sound stupid but I think it doesn’t matter, where the language gets longer to write the code editor should pick up and do code completion to speed things up, like FDT does so well for ActionScript.

Anyway, I will probably never do so because I am not a compiler genius, but I think it would be great to head in that direction and see where it leads. Anyone thinks the same? Anyone knows of a languages that tries to do this as its primary objective?

, , , , , ,


Starting out with Alchemy (on a Mac)

So I’m a PC that now works on a Mac. It’s not my choice, but I went along with it to experience the Mac side of things. I don’t hate it, but I don’t like it that much either. That being said, it means that I am a complete noob user. For the past 2 days, I have been trying to make Alchemy work (compiler that let’s you compile C and C++ libraries to a SWC that can be used in Flash) and it wasn’t all that easy.

First I’m going to point you to two articles on how to setup Alchemy. The first one can be found on Adobe Labs and has a detailed list of steps to complete in order to make Alchemy works. The second one is from zaalabs and it gives further information to get it done.

Now, even with those articles I had a lot of trouble to get it to work, mostly because I don’t know a lot about command line stuff. The first thing that confused me was the mention of a bash / shell / terminal interchangeably. Now, I know there is a difference between all of those, but in this case they all mean the terminal. You can access the terminal by going to Applications and inside the Utilities folder you’ll find the terminal.

The second thing that I didn’t understand was how to add something to the system path. This is also¬†referred later on as adding to your paths. This means editing a file that will put a certain path to be handled like a system path so that you can access whatever is in that folder from any directory. To do so you have to edit a certain file named .profile. The problem that I had was that looking around the interweb for adding to the system path I found that I had to edit a file named .bash_profile. Well it turns out that both works but you just need one of those, if you put some info in one and some info in the other, just one of the file is going to be used so it won’t work. Just use .profile as mentioned in Adobe doc. Now that file is a hidden file (it starts with a “.”) and to see if it exist, in terminal, you must, right after you open it, write “ls -a”, the -a option will show you file that starts with a “.”. If the file .profile doesn’t exist you can create it using an editor like pico by writing “pico .profile”, writing what you need in it and saving the file. Just to help out, here is what my .profile file looks like after I have completed all the steps:

source /Users/dominicg/library/Alchemy/alchemy-setup
export PATH

Last note to be sure everything works, you need to use the Flex SDK 3.2 and no other version. That particular SDK can be found here.

Well I hope this will help some of you. I pretty much shifted focus from Alchemy since I started writing this article, but I am sure I will get back to it at some point.

, , , , , ,

1 Comment

Parse error: syntax error, unexpected ';' in /homepages/25/d169645162/htdocs/wp-content/themes/fusion/footer.php on line 13