Page 3 of 3

Posted: Thu Mar 13, 2008 10:06 am
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.

Posted: Thu Mar 13, 2008 10:53 am
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.

Posted: Thu Mar 13, 2008 11:10 am
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.

Posted: Thu Mar 13, 2008 2:44 pm
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.

Posted: Fri Mar 14, 2008 5:44 am
by Solar
@ Paw:

No negative connotation to low-level control maniac... I think I like that. :-D

Posted: Fri Mar 14, 2008 11:38 am
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.

Posted: Sat Mar 15, 2008 10:21 am
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.

Posted: Sun Mar 16, 2008 2:23 pm
by Dex
And once you have written your OS, it's one of the easiest to port to your OS 8) .

Posted: Sun Mar 16, 2008 2:24 pm
by nekros
cool