Forums

Cobra instead of PHP and/or Javascript?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Re: Cobra instead of PHP and/or Javascript?

Postby MaximC » Fri Jun 08, 2012 5:55 pm

Charles wrote:Re: running on all platforms off one x86 binary, I doubt it. But then I don't know where you can get that anyway. For example, the Python community has a tool to make a Windows .exe, but that's not going to run on Linux (sans Wine). And Mac OS X uses application bundles ("Foo.app") with a specific directory layout, that no one else uses.


I guess what I meant is out of one "Source File" with a Mono bundle being used. I'm assuming that if Mono works on most OS and Mono should allow Cobra to be run on most of these OS, then it should come down to wether Mono needs to be installed or if Mono was "bundled" with the code.

I'm trying to piece it together, and I'm sorry if this all sounds a bit novice or beginner. This is clearly not to the level of adding features to Cobra Language, but I'd really like to try and re-learn programming with Cobra right away instead of having to go through, Python, then C# and then Cobra. Books and sources of info are scarce but these forums and a few articles been a lot of help.
Last edited by MaximC on Fri Jun 08, 2012 10:17 pm, edited 1 time in total.
MaximC
 
Posts: 15

Re: Cobra instead of PHP and/or Javascript?

Postby Charles » Fri Jun 08, 2012 7:25 pm

Yes you should be able to write one code base, although to the extent that you use or must interact with things in the "environment", you will need some special cases. An example of that is Cobra's own installer which is one code base, but one which checks for Windows vs. Unix-family and Mono vs. .NET.

I presume that as part of learning you are also reading through http://cobra-language.com/how-to/ and http://cobra-language.com/samples/

If you have suggestions for more how-to's and samples, please share.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Cobra instead of PHP and/or Javascript?

Postby MaximC » Sat Jun 09, 2012 10:24 am

Charles wrote:Yes you should be able to write one code base, although to the extent that you use or must interact with things in the "environment", you will need some special cases. An example of that is Cobra's own installer which is one code base, but one which checks for Windows vs. Unix-family and Mono vs. .NET.


True.

Charles wrote:If you have suggestions for more how-to's and samples, please share.


I found this, while browsing on C#:

http://en.wikibooks.org/wiki/C_Sharp_Programming

I found it to be a good a brief presentation of C#. The interesting thing is that they go over the syntax for everything, and they go through the variables and operators. When someone have experience and come from a background of many other similar Object Oriented languages, this might not be all that important, but for beginners, it is very helpful.
MaximC
 
Posts: 15

Re: Cobra instead of PHP and/or Javascript?

Postby Charles » Sat Jun 09, 2012 12:35 pm

I agree. That's a sizeable project. I wonder if someone here should work on this while I continue with compiler enhancements. :D
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Cobra instead of PHP and/or Javascript?

Postby MaximC » Mon Jun 18, 2012 7:19 pm

It's clear to me that Cobra can be a good choice to replace PhP/Python/Ruby for server-side scripts or programs to build powerful web applications. Now I'm wondering if there would be a way for Cobra to be used instead of Javascript for client-side scripting.
From what I understand, the scripting language have to be supported by the browsers so that it can be used inline and/or interpreted from a file. So I see that for Cobra to be able to replace Javascript, it would either need to gain in popularity so that browsers start supporting it, or maybe there could be a way that Cobra compile into Javascript, similar to Coffeescript and Objective-J.

I'm really trying to avoid poorly designed languages like PhP and Javascript even though they are the standards. If I can use something promising like Cobra from the start and learn with it all the way to Coding Rock Star, I will.

What are everyone's thoughts on that?

edit: Maybe the program that compiles Cobra into Javascript and its code highlighting feature could be called Cobrascript?
MaximC
 
Posts: 15

Re: Cobra instead of PHP and/or Javascript?

Postby MaximC » Mon Jun 18, 2012 8:30 pm

I guess what I'm trying to say is that, is it possible/doable to do with Cobra something like what the guys did with Objective-J and Cappuccino Framework porting a lot of good stuff from Cocoa? I know we are far from that at this moment, but could the language itself permit something like that in a distant future, or is Cobra and Javascript really incompatible and much too different?
MaximC
 
Posts: 15

Re: Cobra instead of PHP and/or Javascript?

Postby torial » Mon Jun 18, 2012 8:47 pm

Are these the kind of things you are thinking of (two are commercial)?


Since Cobra compiles down to C# first, this sort of thing should be feasible.
torial
 
Posts: 229
Location: IA

Re: Cobra instead of PHP and/or Javascript?

Postby MaximC » Tue Jun 19, 2012 4:52 am

torial wrote:Are these the kind of things you are thinking of (two are commercial)?


Since Cobra compiles down to C# first, this sort of thing should be feasible.


Yes! That is precisely what I was looking for! I could not find these by myself apparently. Thank you very much for pointing me to these.

As for a Cobrascript, that would definitely be nice thing to have eventually since Web Application, SaaS and Cloud seems to be the future of computing, and then we could pretty much do all our code in Cobra either for desktop or Web App with a powerful and beautiful client-side and server-side language.
MaximC
 
Posts: 15

Previous

Return to Discussion

Who is online

Users browsing this forum: No registered users and 29 guests