LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Best Compiled Languige For File IO (https://www.linuxquestions.org/questions/programming-9/best-compiled-languige-for-file-io-911780/)

Zssfssz 11-03-2011 11:27 PM

Best Compiled Languige For File IO
 
I am in need of a programing language that has these characteristics:
Great text file io; Can read whole lines easy or you can speciphy which line to read from
Great Binary file io; fast (optional) an has a variable for storing this kind of stuff
Fast Data processing; Mainly in the basic Logic Gates
Doesn't need to be portable (I hate java)
Can get user imput easy (theres a reason I said 'compiled')
Has conditional statements (^)
Not assembly (it's a pain
Does not compile into a intermediate language (eg javas bytecode or a scripting language)
NOT JAVA
Not Made by Sun
Not bought by oracle
Not C#
Not a rip off of java made by microsoft
C and C++ arnt one of these (as in they don't have one of the needed charicrteristics)
Well I need this soon so... Thanks (answer the question or else that means nothing to you)

pgpython 11-04-2011 04:42 AM

I find your requirements somewhat strange. First of all I can't think of any language which doesn't have any conditional statements. It would be pretty useless if it didn't. Even SQL has conditional statements and that has a restricted domain.

Secondly you are severely under estimated the power of scripted languages. In terms of ease of use and development time. Scripted languages are the best at doing that. You have all the power of a compiled language expressed in a few lines. If you want to develop something quick and easy ditch the compiled language go for scripted.

The are only 3 areas I can think of where a scripted language would most likely short. The first is speed. Scripted languages allow you to express more at the expense of added overhead (consume more memory, slower). However that is a relative decision because they are fast enough to do 99% of problems and memory isn't really a concern with modern computers I would say. second compiled languages tend to do multi threaded applications better. If that is your concern then stick to a compiled language. Third is embedded systems due to point 1.

Java is not one of my favourite languages I have to admit but it could be argued it is a good compromise between a compiled and scripted language. For that reason don't throw it out because of some petty dislike. If you don't want to use sun java. well there are plenty of other people who produce java including the GCC java.


C is the fastest language. The only thing that beats C in speed is well designed and optimised assembly and I wouldn't recommend assembly but again it is relative because a language which is slower would be better if it allowed you to express more in fewer languages because its fast enough that you wouldn't notice the difference between them. On that basis either C or C++ might be valid or not valid.

If having considered all of the above you still feel none of them above are suitable for whatever reason which you haven't ruled out yet is Objective C.

RockDoctor 11-04-2011 06:35 AM

I recommend APL :p

dugan 11-04-2011 08:31 AM

Quote:

Can get user imput easy (theres a reason I said 'compiled')
Wow. That makes no sense at all.

Anyway, almost all languages can do the following:
Quote:

Can read whole lines easy or you can speciphy which line to read from
Reading whole lines is part of the standard library; reading specific lines is done by reading the whole file and ignoring the lines you don't need.

SigTerm 11-04-2011 08:53 AM

Quote:

Originally Posted by Zssfssz (Post 4515419)
Great text file io;

Define "great".

Quote:

Originally Posted by Zssfssz (Post 4515419)
Can read whole lines easy

Any language.

Quote:

Originally Posted by Zssfssz (Post 4515419)
or you can speciphy which line to read from

Text file is stream of data. It has no line number information. However, you can load entire file into memory and get line you want. And this can be done in any language.

Quote:

Originally Posted by Zssfssz (Post 4515419)
Great Binary file io;

Define "Great".

Quote:

Originally Posted by Zssfssz (Post 4515419)
fast (optional)

Define "fast".

Quote:

Originally Posted by Zssfssz (Post 4515419)
an has a variable for storing this kind of stuff

Define "kind of stuff".

Quote:

Originally Posted by Zssfssz (Post 4515419)
Fast Data processing;

Define "data processing". As far as I know ALL programs process data.

Quote:

Originally Posted by Zssfssz (Post 4515419)
Can get user imput easy (theres a reason I said 'compiled')

Define "easy".

Quote:

Originally Posted by Zssfssz (Post 4515419)
Has conditional statements (^)

Any language.

Quote:

Originally Posted by Zssfssz (Post 4515419)
C and C++ arnt one of these (as in they don't have one of the needed charicrteristics)

Really? Guess you didn't even try to do some research.

Quote:

Originally Posted by Zssfssz (Post 4515419)
Well I need this soon so... Thanks (answer the question or else that means nothing to you)

You're wasting your time and approach problem incorrectly. Grab any language you know and do the task you need to do. Searching for "the best language" is a bad idea. "The best is the enemy of the good". Which means you'll either have to waste next 5 months trying to find "the best language" (with no success) or you could finish the task tomorrow using any available language you already know.

Quote:

Originally Posted by pgpython (Post 4515560)
C is the fastest language.

As far as I know, if programmer is an idiot, any language will be slow. Language alone does not make your program faster.

Zssfssz 11-04-2011 09:12 AM

For all the defines thats Usualy what's right after it in the semicolon(;) there's a level of mild sucurity I need with the program it's self and scripting languages can't do thet. My 'native' (in my terms as current) language is C and C++ with a sprikle of D, I do know assembly but as I said it's a pain. What C and C++ didn't meet was a cretin 'new' factor. The point of this was for me to learn something new, I do have mild experience with other languages than these but those are my favs. Fortran mAY be good for this but I hold it as a bit difficult to work with. I can't tell you how many times I've been pointed to Java, I know it and it's 'Creamy' syntax is rather annoying. I love python and perl if python can't do it but this needs to be compiled. This is mainly for me to expand into the reason I learned programing: File IO (My first language was JavaScript and I got ver annoyed that itcouldnt save a file). I just wanted to know if there was a language geared tworeds this, like perl is made tO have a workaround to every problem (but compiling it). If not I will stay in the kingdom of C and C++ for now.

Sergei Steshenko 11-04-2011 03:21 PM

Quote:

Originally Posted by Zssfssz (Post 4515755)
For all the defines thats Usualy what's right after it in the semicolon(;) there's a level of mild sucurity I need with the program it's self and scripting languages can't do thet. My 'native' (in my terms as current) language is C and C++ with a sprikle of D, I do know assembly but as I said it's a pain. What C and C++ didn't meet was a cretin 'new' factor. The point of this was for me to learn something new, I do have mild experience with other languages than these but those are my favs. Fortran mAY be good for this but I hold it as a bit difficult to work with. I can't tell you how many times I've been pointed to Java, I know it and it's 'Creamy' syntax is rather annoying. I love python and perl if python can't do it but this needs to be compiled. This is mainly for me to expand into the reason I learned programing: File IO (My first language was JavaScript and I got ver annoyed that itcouldnt save a file). I just wanted to know if there was a language geared tworeds this, like perl is made tO have a workaround to every problem (but compiling it). If not I will stay in the kingdom of C and C++ for now.

So, what's wrong with Perl then ? I.e. what's wrong with security, for example ? I still don't get why the language needs to be compiled. FWIW, even a standard dynamically linked Linux executable undergoes some interpretation by ld.so prior to really being executed.

SigTerm 11-04-2011 03:53 PM

Quote:

Originally Posted by Zssfssz (Post 4515755)
there's a level of mild sucurity I need with the program it's self and scripting languages can't do thet.

Do you honestly think that compiled language provide security? Switching to compiled language won't automatically improve anything. Any program can be disassembled, and its algorithm restored. It is especially easy to do if your program uses a lot of system calls.

Zssfssz 11-04-2011 06:09 PM

I said 'mild'. Someone could just use a text editor on a scripted one while on a compiled one they would need to download something first.

Sergei Steshenko 11-04-2011 07:07 PM

Quote:

Originally Posted by Zssfssz (Post 4516140)
I said 'mild'. Someone could just use a text editor on a scripted one ...

So what ? What security are you talking about ? E.g. I was lead integrator of a project involving about 25 engineers, and they could see all the code I wrote (and I could see their code), and a lot of code was in Perl, and they simply did not have write permission to my code.

But if necessary they could copy the whole project tree and make local changes - it wasn't forbidden.

SigTerm 11-04-2011 07:15 PM

Quote:

Originally Posted by Zssfssz (Post 4516140)
I said 'mild'. Someone could just use a text editor on a scripted one while on a compiled one they would need to download something first.

Or somebody could use disassembler on your compiled program, and time required to get disassembler wouldn't make much of a difference (we aren't in dial-up era anymore, you know). If user has read access to the program binary, he/she can reverse-engineer it, and there's nothing you can do about it.

Would you "kindly" explain what kind of security you're talking about?

Zssfssz 11-04-2011 09:07 PM

If my grandma could find the souce with command prompt, it's not good enough. Useing edit on a scripting language is much more likely than her ever downloading anything. And yes she uses windows.

SigTerm 11-04-2011 09:58 PM

Quote:

Originally Posted by Zssfssz (Post 4516224)
If my grandma could find the souce with command prompt, it's not good enough. Useing edit on a scripting language is much more likely than her ever downloading anything. And yes she uses windows.

Okay, I get it. You're afraid that somebody will reverse-engineer the program, and don't understand that when software is somewhat big and complicated, it doesn't matter whether it is script or compiled - you'll need to spend some time to actually understand it.

Solution #1:
Put software onto web server, communicate with it via HTML/PHP frontend and never install it anywhere. As long as server is secure, nobody will be able to read the source, since it is not available. I do not know any other way to protect your program from being reverse-engineered. Any other protection can be bypassed.

Solution #2:
Forget about that idea, and concentrate on making good bug-free program instead.


If you're actually afraid that user will break your program accidentally, then install it in read-only mode for normal users, and allow only system administrator (root) to modify the script. Of course, it won't help you if user works under admin account, but you can't do anything about it - administrator's account (root) is in "god mode" by definition and can do anything.

Zssfssz 11-04-2011 10:58 PM

Ok..,.... Now ignoring the 'compiled' part of the question what is your answer?
BTW: My grandma is horrible at the computer, I dought she could even gat to command prompt, let alone get to edit.

Sergei Steshenko 11-05-2011 06:27 AM

Quote:

Originally Posted by Zssfssz (Post 4516286)
Ok..,.... Now ignoring the 'compiled' part of the question what is your answer?
BTW: My grandma is horrible at the computer, I dought she could even gat to command prompt, let alone get to edit.

I still don't understand how security in the context of computer software is related to source availability.


All times are GMT -5. The time now is 06:38 AM.