You are not logged in.
Hi.
I learned C++ for years, from books and lately in College. I also fiddled a bit with assembly.
You see, I always went down the ladder towards the hardware, and now I find it quite hard to write anything useful.
I want to learn another programming language for little tools and programs which doesn't need the degree of control C++ gives me in the cost of development complication.
About a year ago, after doing some research, I found Ruby. I thought it to be somewhat the opposite to C++. Easy to program, not compiled, slow. Actually it really is what I thought but I don't like it very much. There is nothing wrong with the syntax and the speed is not THAT awful, but in order to use ruby programs I need Ruby to be installed. This is a big letdown.
If I sum the characteristics of the language I am looking for it would be something like:
1) Relatively easy to write. More importantly, I want to avoid rewriting general code and manage memory.
2) Compiled language. I don't want my produced program to require any runtime environment or an interpreter.
3) The programs should be fast enough. It doesn't have to be real time, but I don't want to wait a second or so for each little tool I run.
Any suggestions are appreciated.
Thanks!
Offline
How 'bout shell scripting? It's not compiled but there's a sh in every Unix / Linux box.
Offline
Perhaps D? I haven't tried it, but it's compiled and higher-level than C++.
Offline
Haskell is also compiled and is high level.
This silver ladybug at line 28...
Offline
How about Euphoria ?
Euphoria is a simple, flexible, and easy-to-learn programming language. It lets you quickly and easily develop programs for Windows, DOS, Linux and FreeBSD. Euphoria was first released in 1993. Since then Rapid Deployment Software has been steadily improving it with the help of a growing number of enthusiastic users. Although Euphoria provides subscript checking, uninitialized variable checking and numerous other run-time checks, it is extremely fast. People use it to develop Windows GUI programs, high-speed DOS games, and Linux/FreeBSD X Windows programs. It is also very useful for CGI (Web-based) programming
I used to use it myself, a few years ago now, along with Linoleum:
http://anywherebb.com/bb/layout/html/frameset.html
L.in.oleum is an unstructured, untyped, procedural programming language. And more specifically, it's a form of cross-platform assembly language. It is oriented to the developement of general-purpose applications, especially when 100% portability, execution speed and module compactness is requested. This language has an almost 1:1 source-to-CPU instruction ratio, allows direct access to five general-purpose registers (performing basic operations from a theoretical 2 up to a pratical of even 10 times faster than memory-held variables), and if used well, is averagely twice as fast as C in pure computational power. Those who are familiar with Java, could imagine L.in.oleum to be based on similar concepts of hardware abstraction, but from a low-level standpoint. Other important highlights concern the inner coherence, clarity and simplicity of its syntax. The (admittedly cryptic) acronym stands for Low-level INterfaced OverLanguage for Extremely Universal Machine-coding, but nevermind it and just friendly call it Lino, like many do...
Two interesting ones for you...
Deej
Offline
You could look at Go (http://golang.org/). It is still new, but has some really smart people behind it, and the community is growing. I really like using it so far.
Offline
Keep in mind that while other high level compiled languages may be more simple than C/C++, you won't have the library support that you would have otherwise. I suppose it depends on what you want to do.
Offline
Python + Freeze. (Although most people will have Python installed anyway.) Be aware that this will basically link the python runtime statically. (See the comments on the linked page for more info.)
Python is said to be faster than Ruby and in practice it has been fast enough for me. I like it because it makes solving problems easy and I always found a module for what I wanted to do.
Offline
Your deamands really narrow down things: Haskell, D and the fresh new Go. There are some exotic languages out there too, but I doubt that they have big enough (and usable) standard library and/or bindings. Also, what exactly do you want? Which platform you target? On windows for example, .NET is there out of the box, you could target that even from linux with mono. Do you want portable binary or portable source code? Haskell compiles into machine code, but the compiler is a beast, so from a perspective its lighter to code in python even if it requires the runtime which is already installed on most unix(-like) box.
Define the job a bit more clearly and find the right tool for it. There is no universally-great-for-everything language out there.
Offline
Perl, what can't you do in perl? Well a lot ... but! You can to pretty much do everything your heart desires, from a one liner to a complex OO application.
Offline
Perl, what can't you do in perl? Well a lot ... but! You can to pretty much do everything your heart desires, from a one liner to a complex OO application.
Except that it's not compiled, requires an interpreter on each target platform, and is not fast in comparison to a compiled language (unless you're coding modules in C)... in short, it doesn't meet most of the OP's requirements.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
.
Last edited by fumbles (2020-09-26 11:30:42)
Offline
@fumbles
I am not familiar with any freely available Perl compilers that generate independent executables. Can you give an example?
As for the incompatibility of speed and automatic memory management, I think it depends on the compiler. As pointed out previously, Haskell seems to have both and benchmarks agree.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
.
Last edited by fumbles (2020-09-26 11:31:26)
Offline
Indeed, Haskell (and functional programing in general) is hard to pick up with imprative background.
Offline
Learning to think functionally is worth it.
Offline
I waited for enough opinions and now the time to reply comes.
I will tell you the program that comes to my mind as an immediate need for such a language. I tried to write a custom mail server for my friend in C++ with winsock2 (It's for Windows server 2008). I'm in the middle of it and most of it goes well. The problems start when I have to know how much memory to allocate for buffers I send to various external functions to fill, and when I have to decide which multithreading library suits me best, and when I realize that a thread per connection is a bad idea and I have to reprogram some of my code
In general it is possible to use C++ but it takes too much time.
Now to your suggestions:
@karol (shell scripting)
I will need it for windows too and its definitely not fast enough.
@Barrucadu (D)
You are right. *perhaps* I've read quite much about the language but I can't learn every language I think may fit before I choose. It is in the "perhaps" list though.
@lolilolicon (Haskell)
I found the language to be very interesting. More about Haskell in a minute.
@deej (Euphoria and Linoleum)
These languages were a surprise. I've never heard of either one of them. Linoleum is very interesting in it's concept but as I see it doesn't fit the need right now. It's too low level. Euphoria's site looks like the early days of geocities It is interesting, and I'll remember it, but correct me if I'm wrong, it's not *that* widely used and this raises some doubts. Does it have enough libraries that support it? Does it have enough development force behind it? I don't say it's not good, but I will take me more time to get used to it's existence
Thank you!
@tom5760 (Go)
This language was my first candidate when I start looking for a language. It has it's drawbacks though. It's speed is, currently, even slower than Haskell's in part of the tests and the library support is still lacking. I am still not sure about the complexity of using it.
@dalingrin (not many libraries as in C++)
It's ok, one library per task is sometimes better than 20 per task. My need are not too great right now.
@wuischke (compiled Python)
Sorry, Python is not fast enough, and embedding an interpreter in my programs is out of the questions. If i make 20 small command line tools for a Pythonless environment, I don't want 20 copies of the interpreter.
@ijanos (Haskell, D, Go, .NET)
Your answer seems more wide than the others. Thanks. All your three offers seem good to me. I would probably go with one of these.
Why do you say .NET is compiled? It's sort of compiled, yes, and it is fast enough usually, but it need the .NET runtime. As far as I know the compilation produces some middle-way code, rather than native code, and I don't want to target a specific platform and depend on a runtime environment.
I don't care about the "lightweightness" of the development environment, just the produced product interests me.
And for you I defined the job more clearly above, a mail server for example.
@fumbles (perl)
Sorry, perl needs an interpreter, I doubt it's fast enough, and people say it's syntax is somewhat cryptic. I think I'll try Python before perl. Thanks anyway.
Right now I started reading "Learn you a Haskell" and "Real World Haskell" and I started to love the functional idea.
Thank you all for your suggestions and I would be happy to hear more of your opinions if you want to share them.
Offline
Why not learn Lisp?
Offline
i'll +1 haskell. i've been reading learn you a haskell for the past three days, it's very interesting. i've been using xmonad for a while so i've seen it before but there are alot of 'a ha' moments as i go through that tutorial. the idea of lazy evaulation, using recursion rather than loops,and the quickSort example alone is worth the read. good luck in whatever you decide.
//github/
Offline
I started with python and it is very good language in my opinion. Currently started with this tutorial. Yet to learn a lot.
Offline
Could use Lua, it may need an interpreter, but there is the option to compile it.
There is a difference between bleeding [edge] and haemorrhaging. - Allan
Offline
I just had to google "learn you a haskell" after reading this thread. Thought it was a typo, but was worth the search. But I've found http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf to be a better introduction and has worked better for me.
/etc/rc.d/ is where daemons reside. Beware.
Offline