What programing language is this?

i_hate_toms

New Member
Hello all.
I'm a University student of computer science engineering, and we have a subject called "Operating System Designing Concepts".
Every time the book explains something with an example, they write code in a weird looking language which i can hardly figure. I'll post an example here:-

module m_p_c
b_b: monitor;
begin
buffer:array[1..capacity] of item;
in, out : (1..capacity);
count : (0..capacity);
mayproduce, mayconsume : condition;
procedure mput(pitem : item); {public}
begin
if count = capacity then mayproduce.wait;
buffer[in] :=pitem;
in := (in mod capacity)+1;
count := count+1;
mayconsume.signal
end; {mput}
procedure mtake (var citem : item); {public}
begin
if count=0 then mayconsume.wait;
citem :=buffer[out];
out := (out mod capacity)+1;
count := count-1;
mayproduce.signal
end; {mtake}
{monitor body - initialization}
in :=1;
out :=1;
count := 0;
end b_b;
end {m_p_c}

What the eff is this language? Why won't they use 'C'?
I cannot figure out a thing.
If someone here can work this out, it'd be great if you could help me understand this. Not just this one program, but the programming language that's being used. The book has thousands of programs written in this style, it'll get annoying for you guys if i keep posting 15 programs here, every day. a better solution, would be if someone can help me work out this language. The only languages i've learned so far in the university, except for some assembly languages, are C, C++, Java, VisualBasic, and HTML (if HTML counts as a language.) This code sample, doesn't remotely look anything like the languages i otherwise program in (not professionally of course, we need to write these homework stuff)
Thanks for your time friends. Really appreciated. :good:
 
Last edited:
doesn't look like C to me :(

It's similar to C, so I'm going to take a stab and say it's C#.
Thanks for ur reply, but how is this similar to C?
I don't see anything 'C' here.
No header files, no type declarations, no structures, no arrays, no unions, no C style function prototypes, no C style function definitions!
I had C two semesters back, unfortunately i don't remember a single "C' program written this way :(
Thanks for writing though, i appreciate your time ..
 
Last edited:
It looks like "Pascal".

OMG Pascal?! :(
I've got absolutely no idea of anything Pascal. The only thing i know, is there's this language called Pascal. Nothing else. Looks like I'll have to learn, at least, some basics of Pascal - if i want to make any sense of this book at all.
Would be great if there's a free ebook on the basics of pascal, available online, got any suggestions / link??
Thanks for your answer Alien, I had no clue, until i read ur post.
Still can't make any sense of these programs, but at least i know where to begin :)
 
I wouldn't say Pascal is useless but it isn't used much anymore. Back in the late 80's Borland's Turbo Pascal was THE hot programming environment. It was one of the first compilers to have an IDE.

Here's a link to an Open Source Pascal compiler if anyone is interested: Free Pascal

Here's a link to download Turbo Pascal 5.5 for free: Turbo Pascal 5.5 download
 
Last edited:
I wouldn't say Pascal is useless but it isn't used much anymore. Back in the late 80's Borland's Turbo Pascal was THE hot programming environment. It was one of the first compilers to have an IDE.

Here's a link to an Open Source Pascal compiler if anyone is interested: Free Pascal

Here's a link to download Turbo Pascal 5.5 for free: Turbo Pascal 5.5 download

Today it is pretty useless, and outdated, like I said on my earlier post :)
 
Today it is pretty useless, and outdated, like I said on my earlier post :)
I disagree that it's useless. It is still fine for what it was originally intended for, to teach programming concepts. It has been usurped by more modern languages but that doesn't make it useless.
 
I disagree that it's useless. It is still fine for what it was originally intended for, to teach programming concepts. It has been usurped by more modern languages but that doesn't make it useless.

You don't need Pascal to teach programming concepts, hence the useless part of it...

To be honest I've had a harder time learning Pascal than any other languages I've learned.
 
You don't need Pascal to teach programming concepts, hence the useless part of it...

To be honest I've had a harder time learning Pascal than any other languages I've learned.
You could say that you don't need ANY programming language to teach programming concepts, so does that mean all programming languages are useless?

I find it hard to believe that you would have a harder time learning Pascal vs any other language as it is about the most straightforward programming language I've encountered in my almost 30 years of software development experience.
 
You could say that you don't need ANY programming language to teach programming concepts, so does that mean all programming languages are useless?

I find it hard to believe that you would have a harder time learning Pascal vs any other language as it is about the most straightforward programming language I've encountered in my almost 30 years of software development experience.

Probably because I've mainly learned website programming.

What I meant is that the syntax is too thorough compared to newer languages.
 
You could say that you don't need ANY programming language to teach programming concepts, so does that mean all programming languages are useless?

When a program is used only for introduction to programming that's where I draw the line, you can do that with any other language, therefore it is useless.
 
Probably because I've mainly learned website programming.

What I meant is that the syntax is too thorough compared to newer languages.
The syntax was purposely strictly enforced in order to learn good programming practices.

Besides, what do you know? You're a self-proclaimed punk! ;)
 
Here's a link to an Open Source Pascal compiler if anyone is interested: Free Pascal

Here's a link to download Turbo Pascal 5.5 for free: Turbo Pascal 5.5 download

Thanks for those links Strollin, u saved the day :)
I'll now install both, and I've downloaded an ebook on pascal.
Not very difficult once you read the first couple of chapters... specially, the concept to "set" type variables, looks pretty neat and cool :)

Punk, thanks for your input too. :)
As long as the university wants me to learn pascal, it doesn't matter if it's old and obsolete. I will need to learn it anyway, or I'll fail next semester :P

Strollin, thanks again. Great answer. And with 30 years of programming experience, i wish you were my neighbor :P , i could learn so much from you! :) :good: :good:
 
Last edited:
Thanks for those links Strollin, u saved the day :)
I'll now install both, and I've downloaded an ebook on pascal.
Not very difficult once you read the first couple of chapters... specially, the concept to "set" type variables, looks pretty neat and cool :)

Punk, thanks for your input too. :)
As long as the university wants me to learn pascal, it doesn't matter if it's old and obsolete. I will need to learn it anyway, or I'll fail next semester :P

Strollin, thanks again. Great answer. And with 30 years of programming experience, i wish you were my neighbor :P , i could learn so much from you! :) :good: :good:

Yeah and if that helps I was using DevPascal at the university.
 
Punk, IMO, when someone with more programming experience than my age on the planet, writes something about a programming language, i guess his opinion counts (this doesn't mean your opinion doesn't count, your opinion counts too!). It's because of programmers and thinkers of their generation, that our generation is using computers the way they are now.
I'm not saying you're wrong, all I'm saying is, strollin must be right. :)
Chill bro, i never questioned your knowledge :) :good:
 
Punk, IMO, when someone with more programming experience than my age on the planet, writes something about a programming language, i guess his opinion counts (this doesn't mean your opinion doesn't count, your opinion counts too!). It's because of programmers and thinkers of their generation, that our generation is using computers the way they are now.
I'm not saying you're wrong, all I'm saying is, strollin must be right. :)
Chill bro, i never questioned your knowledge :) :good:

Haha if Strollin is right then I'm wrong (which is a possibility).

I don't know why you felt the need to tell me to chill as I was far from being pissed off but ok, I will listen to some reggae now :D.

Anyways check out DevPascal if you want to choose between different Pascal developping environement :).
 
Haha if Strollin is right then I'm wrong.

Not necessarily. Light is both a particle, and an electromagnetic wave :P
the two of you might be analyzing the situation from different viewpoints?
I inferred you were offended cause you posted a message just about your educational background, which kinda implies the rest of us thought you weren't qualified enough to make an educated statement. thought it'd be better to make my stand clear, i never questioned your knowledge. reggae ?! :D
i'm thinking of smoke on water :D
Anyway, devpascal, i'll take a look at it now. To be honest, neither am I very thrilled about having to learn a language which i probably won't ever be using in the foreseeable future, i don't intend to be a pascal expert, i just want to learn the basics, so that i can figure out the code examples in my "OS Designing" book. For some reason I cannot think of, the author of the book chose to use pascal instead of C, and the university website has this book on top of the "recommended study materials" list.
Thanks for writing, enjoy that song :)
 
Not necessarily. Light is both a particle, and an electromagnetic wave :P
the two of you might be analyzing the situation from different viewpoints?
I inferred you were offended cause you posted a message just about your educational background, which kinda implies the rest of us thought you weren't qualified enough to make an educated statement. thought it'd be better to make my stand clear, i never questioned your knowledge. reggae ?! :D
i'm thinking of smoke on water :D
Anyway, devpascal, i'll take a look at it now. To be honest, neither am I very thrilled about having to learn a language which i probably won't ever be using in the foreseeable future, i don't intend to be a pascal expert, i just want to learn the basics, so that i can figure out the code examples in my "OS Designing" book. For some reason I cannot think of, the author of the book chose to use pascal instead of C, and the university website has this book on top of the "recommended study materials" list.
Thanks for writing, enjoy that song :)
To each his own taste but I also like Deep Purple :)

I talked about my educational background to point out that I have learned mainly website scripts therefore having a different opinion on Pascal :). Strolling is probably better (I'm pretty sure of this) than me at programming though.
 
Back
Top