What would you want in a programming language?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Paw
Member
Member
Posts: 34
Joined: Fri Mar 07, 2008 11:20 am

Post by Paw »

Yayyak wrote:We can only hope.

One thing I like about newer languages (in general) as opposed to older ones (within the C family) is that they don't require header files. I hate header files. Java doesn't need them, and it saves so much time. You just need a smart compiler/linker.
Pascal does it for a while with the "uses" statement followed by a list of module/unit identifiers.
Anyway, I have to agree, it's way better, since this kind of burden should be taken away from a programmer.

However, for some reason I believe that a couple of hard-core C(++)-programmers would disagree with it, and might actually think of it as a step into the wrong direction, because they tend to be low-level-control maniacs.

EDIT:

Back to topic: I believe, there isn't much use of a domain-specific programming language in terms of operating systems, because there are too many varying aspects in it, which require a general purpose programming language.
The domain specific needs can be satisfied by libraries, and I don't see much need for special language constructs, which help improving on OS deving, except for strict type checks, constraints etc.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Paw wrote:However, for some reason I believe that a couple of hard-core C(++)-programmers would disagree with it, and might actually think of it as a step into the wrong direction, because they tend to be low-level-control maniacs.
Ah, thank you for thinking so highly of my capability for reason. :x

I happen to like (well-written) header files, because they provide me with a one-glance overview of the public interface without implementation details, helper functions etc. getting into the way.

For Java, I need either an IDE or a seperate JavaDoc run (plus "documentation browser") to do the same.

That isn't to say there isn't something good to be said about header-less languages. But I took exception to the notion that you have to be mentally deranged to like header files.
Every good solution is obvious once you've found it.
Paw
Member
Member
Posts: 34
Joined: Fri Mar 07, 2008 11:20 am

Post by Paw »

Solar wrote:
Paw wrote:However, for some reason I believe that a couple of hard-core C(++)-programmers would disagree with it, and might actually think of it as a step into the wrong direction, because they tend to be low-level-control maniacs.
Ah, thank you for thinking so highly of my capability for reason. :x

I happen to like (well-written) header files, because they provide me with a one-glance overview of the public interface without implementation details, helper functions etc. getting into the way.

For Java, I need either an IDE or a seperate JavaDoc run (plus "documentation browser") to do the same.

That isn't to say there isn't something good to be said about header-less languages. But I took exception to the notion that you have to be mentally deranged to like header files.
Sorry Solar, I did not intend my statement to be a personal attack, since I don't see a negative connotation in "low-level control maniac". Someone capable of handling such advanced technical issues is far from being mentally deranged, as you put it.
My intention for that wording was humorous. Next time I put a couple of smilies alongside with such statements.

Besides that, you certainly have a point I didn't think of, in my above post, maybe because I'm too used to using IDEs and code documentation generation tools.
The separation of the interface into separate header files is indeed a good thing in order to have a quick and simple API overview.
User avatar
Wave
Member
Member
Posts: 50
Joined: Sun Jan 20, 2008 5:51 am

Post by Wave »

I happen to like (well-written) header files, because they provide me with a one-glance overview of the public interface without implementation details, helper functions etc. getting into the way.
That's what the interface section does with pascal files.
Conway's Law: If you have four groups working on a compiler, you'll get a 4-pass compiler.
Melvin Conway
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

@ Paw:

No negative connotation to low-level control maniac... I think I like that. :-D
Every good solution is obvious once you've found it.
Meor
Posts: 13
Joined: Fri Mar 14, 2008 11:29 am

Post by Meor »

I used to write in NASM, FASM, then started writing my own high level assembler language, then realized a perfect language for me already existed.

I use Eiffel. Everything in the language is designed to improve correctness and it allows direct access to C/C++ including inline C function definitions.

-Strong typing
-Generics with generic conformance
-Design by Contract for function correctness
-Garbage collected, multi-threaded, concurrent, compacting
-Simple syntax, less than 40 keywords
-Outputs to C "bytecode" and runs through a C optimizer.

I could go on forever because I fell in love.
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Post by nekros »

Dex wrote:All you need is fasm and you can use the very powerfull macro.
Example1. here is a simple example of turning fasm code into a quick and dirty Qbasic:
Use these macro

Code: Select all

macro PRINT String{

        local .Printer
        local .Nextchar
        local .Done
        local .a

        .Printer:
                mov si, .a
                mov ah, 0Eh
                jmp .Nextchar

        .Nextchar:
                lodsb
                or al, al
                jz .Done
                int 10h
                jmp .Nextchar
                jmp .Done

        .a db String,10,13,0

        .Done:
}  

macro SCREEN mode
{
	push ax

	if mode = 0
		mov ah,0h		;SCREEN 0; Default DOS screen mode
		mov al,3h
		int 10h
	else if mode = 13
		mov ah,0h		;SCREEN 13; VGA
		mov al,13h
		int 10h
	end if

	pop ax
}

macro SLEEP
{
	;Output:
	;ah = BIOS scancode of key pressed
	;al = ASCII character of key pressed
	;Could have also used...
	;	mov ah,8h
	;	int 21h
	mov ah,0h
	int 16h
}

macro END
{
	mov ax,4Ch	;\END
	int 21h		;/
}

macro LOCATE row,col
{
	pusha

	mov ah,2		;Function 2
	mov bh,0		;Use page 0
	mov dh,row	;row
	mov dl,col		;col
	int 10h

	popa
}
And then you can do this:

Code: Select all

	SCREEN 0
	COLOR 33
	LOCATE 5,5
	PRINT "Hello World"
	SLEEP
	END
Example2.
Or using a macro like case

Code: Select all

macro case op1,op2
	{
	cmp  byte [edx],op1
	je   op2
	}
you can do this:

Code: Select all

;;---------------------------------------------------------;;
;;  - Solidus117
;;		Team DexOS
;; Interpret                                              
;;   Interpret the Brainfuck source, acting upon the VMM  
;;---------------------------------------------------------;;
	Interpret:
		mov  edx,loadpoint-1
		mov  ebx,memory

	lp:	inc  edx
		case '+',incval
		case '-',decval
		case '>',incptr
		case '<',decptr
		case '.',putval
		case ',',getval
		case '[',tstjmp
		case ']',uncjmp
		case 00h,@f
		jmp  lp
	@@:	ret
With the aid of some good macro, you can have your low and HLL language,its is call FASM.
I've played with FASM before, even tried writing an OS with it, it got really messy(without macros). Seeing this, I really like it :D , I might just rewrite my OS in it.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

And once you have written your OS, it's one of the easiest to port to your OS 8) .
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Post by nekros »

cool
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Post Reply