Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Use programming language as terminal language?

Use programming language as terminal language?
Thread Tools
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Nov 22, 2002, 12:24 AM
 
Is there a way (or a program) to use multiple languages right in the terminal? I'd like to basically be using programming languages as my means of working in the terminal, instead of all these shells like Bash and tcsh. Example:

%NSString *myString = [NSString alloc]
%myString = "user@website.com"
%NSMailTo myString
%cd /; ls

So it would be like I am the program, running at a human pace. This way I can do what I need to do, rather than having a program written in advance to do it, with a GUI and everything. Sometimes I don't want to make that investment just to get stuff done.

But only this needs to go even further, where multiple languages can be used in the same context, they only need be marked.

%FT <= $Fortran
%OC <= $Obj-C
%TC <= $tcsh
%OC | NSString *myString = [NSString toString:FT | sqroot(3+5) | ] |
%FT | OC | [myString toInt] | +9 |
%TC | cd OC | NSHomeDirectory | ; ls |

Well, doesn't anybody else think these are needed abilities?
1) A live runtime
2) Multiple languages working together
3) User himself being treated like a program
It just seems like the score of programming languages have between them incredible power, but the only way to wield them is in fully-formed programs. I want to access them directly.
you are not your signature
     
Mac Enthusiast
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 22, 2002, 11:12 AM
 
interesting idea... but I think it may be overkill.

Bash is really good at what it does. If you want a real-time interpreted language, check out python and ruby... you can run programs as you type them, it's pretty nifty
     
Gametes  (op)
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Nov 22, 2002, 11:59 AM
 
What languages does the GCC compiler as it comes on OS X interpret? How do you tip it off to what language you're using in PB?

If this program doesn't exist, I'm thinking of trying to maybe use the compiler or a just-in-time compiler + plugins for each of the languages (if necessary) to create such a system.

Is there any way to send messages directly to the run-time system? Make OS X think the message is a program?
you are not your signature
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Nov 22, 2002, 01:09 PM
 
Originally posted by Gametes:
What languages does the GCC compiler as it comes on OS X interpret? How do you tip it off to what language you're using in PB?
The file extension usually. .m is Obj-C, .cpp or c++ is C++, .c is C, .java is java, etc.


Is there any way to send messages directly to the run-time system? Make OS X think the message is a program?
That's tough. I remember LisP could do that, but that's a pretty weird language compared to C, java, etc.
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Nov 22, 2002, 04:07 PM
 
Well, back in The Day, part of the WebObjects development environment was this cool thing called WebScript. It was basically an interpreted version of Objective-C, with a few useful data-processing extras. Stepwise once documented how you could set up a WebScript-based shell.

Alas, WebScript went away around the same time ObjC-based WebObjects did. It would theoretically be possible to resurrect it -- you could use the Apple ObjC runtime, you'd just have to write your own parser and frontend.
Rick Roe
icons.cx | weblog
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Nov 22, 2002, 04:11 PM
 
Originally posted by Rickster:
Well, back in The Day, part of the WebObjects development environment was this cool thing called WebScript. It was basically an interpreted version of Objective-C, with a few useful data-processing extras. Stepwise once documented how you could set up a WebScript-based shell.
Sounds like F-Script to me. I'd suppose you could probably do something along those lines with F-Script Anywhere.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status: Offline
Reply With Quote
Nov 22, 2002, 06:43 PM
 
I'd second the call to try out Python. I think it does everything you want and there are ALOT of libraries for it. It is standard on the Mac too. Its main limit is in windowing and wxWindows has a Mac version now. Unfortunately that isn't part of the standard distros. But you can get it at Source Forge.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:23 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2