which programming language should I use for FreeBSD software

Yes but it's been a long time. I remember my boss drag us kicking and screaming and forcing us to buy "the white book" and learn C. This was around 1987. We would do a little C, then mix in our assembly which eventually wound up as an all assembly routine.
 
rockworldmi said:
Has anyone made any application /software with assembly?? and with/without GUI?

Last time I did that was on the Amiga. 68000 assembly is so much easier than x86/x64.
 
Use posix sh for shell scripting. Here is a cheat sheet to for portable programming:

http://rubyprogrammer.net/~stu/posix/

perl, python, and ruby are great scripting languages.

Ruby is an amazing language and worth checking out. It is inspired from perl which is inspired from sh( i.e. sed/awk) awk is great language to pipe and filter to.

Low level programming as it's been mentioned is done with c. C++ of course could be used for app development.

Of course there are ton of languages that you can use for making programs.

Here is info on the subject in the handbook:
http://www.freebsd.org/doc/en/books/developers-handbook/tools-programming.html
 
drhowarddrfine said:
Absolutely! The 68k should have been today's processor of choice.

I used to feel that way, too. I got over it by the mid 90's, though. At that point I didn't care what the underlying machine looked like as long as the target hardware would run compiled C fast enough. And if I had to write a little bit of assembler to fix performance problems (or interrupt handling, whatever) it wasn't like writing a lot of it.
 
SirDice said:
Last time I did that was on the Amiga. 68000 assembly is so much easier than x86/x64.
I liked the MIPS instruction set as seen in e.g. the Silicon Graphics Indy (R4x00). But it doesn't seem to have a whole lot of following anymore these days.

Fonz
 
More on topic, though: there are lots of programming languages out there, so there's a lot to choose from. Some are easier to learn than others, some are more powerful/rich than others, some have better performance than others, some are more fun than others, some are more widespread than others and some are more portable than other.

  • Sh is nice for scripting but not really meant for serious applications.
  • Pascal is very well-designed (from a formal language theory point of view) and ideal for teaching programming to people with no prior programming experience (and there's also a reason why it's often used for teaching compiler building) but it's rarely used beyond educational contexts these days.
  • Perl has seen competition from e.g. Python and Ruby but still it can't hurt to learn it.
  • C is still the most common language for systems programming and seems easy enough, but the details are quite subtle and few people are really good at it.
  • C++ is (in my opinion) quite ugly from a linguistic point of view, but it's still quite useful/educational and combines many features found in other languages.
  • Java is portable, very all-round and can be learned in stages but its sheer performance is still questioned.
  • Haskell is extremely cool but based on an entirely different paradigm and therefore (much) more difficult to learn properly.
  • Assembly can be insightful for specialists but is not at all suitable for beginning programmers.
  • C# is for Windows. And even then, there are better options.
  • If your main goal is to write Internet applications quickly, you might want to consider Rebol. It's not very well-known but quite good at what it's meant for. On the downside, it's useless for pretty much everything else.
Fonz
 
fonz said:
I liked the MIPS instruction set as seen in e.g. the Silicon Graphics Indy (R4x00). But it doesn't seem to have a whole lot of following anymore these days.

Fonz

Ooh! I forgot all about Mips and you're right. And I worked for SGI! Sheesh. But I never got to mess with it on that level and my time there was too short.

Mips manufacturer's stock price had a nice runup a little over a year ago. I had a hand in that having owned some briefly. I really haven't kept track of how the cpu chip fairs nowadays but I do see there are people with a lot of interest in it. Just don't recall who.
 
drhowarddrfine said:
And I worked for SGI!
Way cool, bastard! Dare I inquire what you did there?

Back in the days (mid to late '90s) SGI hardware was the cat's meow. The university where I was a student at the time had a lab room full of blue pizza boxes and later, when they replaced the individual Indy machines with a central quad-processor Sun beast (the machine was actually hostnamed "beast") and SunRay login card readers, I managed to get my hands on a couple of those Indy things as they were auctioned off. I still have one or two sitting in storage, with grey-marble monitors, Indy-Cams and whatnot. In my opinion MIPS was a very elegantly-designed instruction set but the operating system was a mixed blessing. On the one hand it was standards-compliant enough that many Linux (which was only up and coming in those days) applications could relatively easily be ported to IRIX 5.X (Fvwm(2) sure looked better than 4DWM and I have ported several Linux apps to IRIX) but it was also full of potential buffer overflows and I have actually gotten into trouble with the authorities on more than one occasion because of just that. When they found out that I actually knew what I was doing (rather than blindly deploying some exploit code found on the Internet) it led to some mutual respect and the chief sysadmin at that time is still a good friend of mine nowadays, but still: in my opinion IRIX 5.X was as crappy as swiss cheese.

Fonz
 
I was a systems engineer. I was hired for my video expertise to help out at, then, McDonnell-Douglas and their flight simulators. This was in the early 1990s. I went to SGI from Pixar*.

Even though I was based in St. Louis, I was frequently in California. One of the coolest things was eating lunch and have Jim Clark sit down next to you.

*I worked at Pixar when Pixar made hardware. It was that long ago. They promptly let all of us go shortly after hiring us when they got out of the hardware business.
 
drhowarddrfine said:
I was hired for my video expertise to help out at, then, McDonnell-Douglas and their flight simulators.
Or so he casually announced to the aeronautical engineering minor ;)

I wasn't even aware that Silicon Graphics had ventured into that area and it was probably some years before my time, but I sure would have loved to have gotten in on that action. Developing flight simulators for MD? That's way cool! From now on, instead of Doctor I'm going to call you Captain :e

Fonz
 
To show you how stupid things got back then, my boss for the region was in Detroit. He hired me. SGI re-organized and my new boss was based in Dallas. My new boss looked and acted just like J.R Ewing from the TV show "Dallas". He decided he wanted a Fortran programmer and I didn't know Fortran so I was out.
 
iic2 said:
Real men code in HEX! But I'm going to write my first FreeBSD program in pure assembler and if something minor get in my way I'll do the remained of it in straight C.

My list for FreeBSD is:

Sh - Required and Quick
Python, Perl - Slow but Resourceful
C++ - Faster but Slow and Insane
C - Faster
ASM - Pure Lighting (easier)

My list for Windows is:

ASM - Pure Lighting (easier)

In the end you'll do them all.

You're forgetting about the importance of portability.

All but ASM provide that. It's the reason Unix required the invention of C ;)
 
iic2 said:
Real men code in HEX!
How fortunate there's a lot of women and "fake" men coding, too, for they make the code that is actually maintainable.

iic2 said:
C++ - Faster but Slow and Insane
The "Faster but Slow" part seems quite contradictive.
To put things right, C++ is faster to develop applications in, but takes more time to learn and ages in completely mastering it, mostly due to it's over-complicated grammar.

I agree with fonz description.
 
Lately (time permitting) I've been looking at the Scheme programming language, basically, it's a lighter/minimalistic version of Lisp.

I find it interesting because the language is so radically different from anything else I've ever used, and some of the skills and idea's I've picked up from Scheme have been useful in other procedural/OOP languages as well. Specifically it really helped me truly grasp the concept of recursion to the point where it's actually useful in much more scenarios then before.

The little Schemer is a great book, although the writing style may not be to everyone's liking. There's also Teach yourelf Scheme in fixnum days (Free!).
There are a whole bunch of Scheme interpreters available, I use Chicken Scheme (lang/chicken in ports).

I don't know how Scheme/Lisp compares to other functional languages such as Haskell, OCAML, Erlang, etc, but I've found that learning "pure" functional programming is pretty useful even in you spend most of your time in other languages.
 
Carpetsmoker said:
Lately (time permitting) I've been looking at the Scheme programming language, basically, it's a lighter/minimalistic version of Lisp.

I find it interesting because the language is so radically different from anything else I've ever used, and some of the skills and idea's I've picked up from Scheme have been useful in other procedural/OOP languages as well. Specifically it really helped me truly grasp the concept of recursion to the point where it's actually useful in much more scenarios then before.

The little Schemer is a great book, although the writing style may not be to everyone's liking. There's also Teach yourelf Scheme in fixnum days (Free!).
There are a whole bunch of Scheme interpreters available, I use Chicken Scheme (lang/chicken in ports).

I don't know how Scheme/Lisp compares to other functional languages such as Haskell, OCAML, Erlang, etc, but I've found that learning "pure" functional programming is pretty useful even in you spend most of your time in other languages.

I'm looking at Lua, D, and Ada. FWIW, OpenMP enabled GCC compilers (and non-free supporting compilers, too) make for nice interfaces for multi-threaded programming.
 
Well hopefully the OP figured this out, but I'll just mention it anyway...

If you're writing software for the FreeBSD project, it should be written in C or POSIX-compliant Bourne Shell (if it's a small utility). Except for a handful of exceptions, there are no other languages in FreeBSD's source code.

If you're writing software that must run on FreeBSD, your options are almost endless. Take your pick. :)

I'm most interested in playing with node.js on the V8 engine, and Go in future.
 
2c.

I would use either

C
Perl
Python
Java

(C, perl and java are available pretty much everywhere)

Work out what other types of workload you may be programming for, any other potential environments you may code for in future, and select a language based on that.

C is going to be faster than the others but it enables the programmer to write code full of buffer overflows and requires the understanding and use of pointers.

I suspect Perl or Python will serve you well - if you prototype in either of those, you can maybe re-write sections of (or your entire) program in C if performance proves to be insufficient.

Diving straight into C from VB for a network daemon is (imho) a recipe for writing exploitable code.
 
freethread said:
For web server side scripting or system scripting (or both)?
Not scripting. It's an event driven framework, a programming paradigm which isn't really relevant to system scripting.

Interested in server side code, not necessarily web-only.
 
Back
Top