Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Chemist who falls in acid will be tripping for weeks.


devel / comp.lang.c / furia (fir's proto-c compiler)

SubjectAuthor
* furia (fir's proto-c compiler)fir
+* Re: furia (fir's proto-c compiler)fir
|`* Re: furia (fir's proto-c compiler)fir
| +- Re: furia (fir's proto-c compiler)fir
| `* Re: furia (fir's proto-c compiler)Kaz Kylheku
|  `* Re: furia (fir's proto-c compiler)fir
|   `* Re: furia (fir's proto-c compiler)fir
|    +* Re: furia (fir's proto-c compiler)fir
|    |`- Re: furia (fir's proto-c compiler)fir
|    `- Re: furia (fir's proto-c compiler)fir
`* Re: furia (fir's proto-c compiler)bart c
 +* Re: furia (fir's proto-c compiler)Joe Pfeiffer
 |`- Re: furia (fir's proto-c compiler)fir
 +* Re: furia (fir's proto-c compiler)fir
 |`- Re: furia (fir's proto-c compiler)fir
 `* Re: furia (fir's proto-c compiler)fir
  +* Re: furia (fir's proto-c compiler)fir
  |`* Re: furia (fir's proto-c compiler)fir
  | `* Re: furia (fir's proto-c compiler)fir
  |  +- Re: furia (fir's proto-c compiler)fir
  |  `* Re: furia (fir's proto-c compiler)fir
  |   `- Re: furia (fir's proto-c compiler)fir
  `* Re: furia (fir's proto-c compiler)bart c
   +- Re: furia (fir's proto-c compiler)fir
   `* Re: furia (fir's proto-c compiler)fir
    `* Re: furia (fir's proto-c compiler)fir
     `* Re: furia (fir's proto-c compiler)fir
      `* Re: furia (fir's proto-c compiler)fir
       `* Re: furia (fir's proto-c compiler)fir
        `* Re: furia (fir's proto-c compiler)fir
         `* Re: furia (fir's proto-c compiler)fir
          `* Re: furia (fir's proto-c compiler)fir
           `- Re: furia (fir's proto-c compiler)fir

Pages:12
furia (fir's proto-c compiler)

<e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21305&group=comp.lang.c#21305

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:318d:b0:69e:6f03:7950 with SMTP id bi13-20020a05620a318d00b0069e6f037950mr10748990qkb.493.1650402026106;
Tue, 19 Apr 2022 14:00:26 -0700 (PDT)
X-Received: by 2002:ac8:7d90:0:b0:2f3:39e2:c247 with SMTP id
c16-20020ac87d90000000b002f339e2c247mr2828416qtd.404.1650402025889; Tue, 19
Apr 2022 14:00:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 19 Apr 2022 14:00:25 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.0; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.0
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
Subject: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 19 Apr 2022 21:00:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 87
 by: fir - Tue, 19 Apr 2022 21:00 UTC

I dont remember if i already wrote on this and how

Last year i practically was not coding spending my time for more like sociology thinking and being sick.. I wonder if not to get back for coding few days, though i must say my eyesight noticably get worse and this is unexpected problem, if letters 'blur' (though blur is not proper word maybe, its more like overlap shifted images maybe) from a meter or so it makes coding much troublesome and i feel pain

hovever recently i wrote elements of my compiler, it takes for now such form of proto-c as i call it...i mean i only take that kind of expression which is extremly easy to translate to assembly (and assembly i assemble with my own assembler)

so it is like thet for example

int mouse_x = 0
int mouse_y = 0

void ProcessMouseMove()
asm mov eax (esp+4);
asm mov (mouse_x) eax;
asm mov eax (esp+8);
asm mov (mouse_y) eax
return

int last_key_pressed = 0
int PAGE_UP = 33

void ProcessKeyDown()
asm mov eax (esp+4);
asm mov (last_key_pressed) eax
if last_key_pressed = PAGE_UP
cdecl "green_fire.dll" ToggleFullscreen()
end
return

void RunFrame()
int background_color = 0

background_color = background_color + 1
cdecl "green_fire.dll" ClearFrameData(background_color);

int r = 10
for r from 10 to 250 step 3
cdecl "green_fire.dll" DrawCircle( mouse_x, mouse_y, r, 0xff00);
end
cdecl "green_fire.dll" DrawSomeText2( 0xffffff, 10, 30, "this app is compiled by furia \x00");
cdecl "green_fire.dll" DrawSomeText2( 0xffffff, 30, 130, "mouse %d %d\x00", mouse_x, mouse_y);
return

void OnResize()
return

void main()
cdecl "green_fire.dll" RegisterRunFrame( &RunFrame );
cdecl "green_fire.dll" RegisterMouseMove( &ProcessMouseMove );
cdecl "green_fire.dll" RegisterKeyDown( &ProcessKeyDown );
cdecl "green_fire.dll" RegisterOnResize( &OnResize );
cdecl "green_fire.dll" SetSleepValue(30)
cdecl "green_fire.dll" SetScaleOnResize(1)
cdecl "green_fire.dll" SetupWindow3(" compiled by fir's furia proto c compiler \x00", 10, 10, 600, 400, 300, 200 );
return

i got a lack ov very fundamental things - one of troublesome things was
the "compilation" (translation to assembly) free-length and free nested of
arithmetic expressions (which may combine ints and floats also logic operators array indexing and more - even simple free arithmetic expresions on ints are troublesome for me)

i got no specific question or topic for discusion for the moment but i post it an possibly i invent some if i get deeper in some problems if i again will wrap my head around it (if thay say that in english)

fir
compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)

http://minddetonator.htw.pl/furia11.zip

Re: furia (fir's proto-c compiler)

<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21307&group=comp.lang.c#21307

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:3e3:b0:444:3f84:d230 with SMTP id cf3-20020a05621403e300b004443f84d230mr13291314qvb.4.1650405854751;
Tue, 19 Apr 2022 15:04:14 -0700 (PDT)
X-Received: by 2002:a37:aec6:0:b0:69b:f82c:7704 with SMTP id
x189-20020a37aec6000000b0069bf82c7704mr11171553qke.362.1650405854430; Tue, 19
Apr 2022 15:04:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 19 Apr 2022 15:04:14 -0700 (PDT)
In-Reply-To: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.82; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.82
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 19 Apr 2022 22:04:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 117
 by: fir - Tue, 19 Apr 2022 22:04 UTC

wtorek, 19 kwietnia 2022 o 23:00:34 UTC+2 fir napisał(a):
> I dont remember if i already wrote on this and how
>
> Last year i practically was not coding spending my time for more like sociology thinking and being sick.. I wonder if not to get back for coding few days, though i must say my eyesight noticably get worse and this is unexpected problem, if letters 'blur' (though blur is not proper word maybe, its more like overlap shifted images maybe) from a meter or so it makes coding much troublesome and i feel pain
>
> hovever recently i wrote elements of my compiler, it takes for now such form of proto-c as i call it...i mean i only take that kind of expression which is extremly easy to translate to assembly (and assembly i assemble with my own assembler)
>
> so it is like thet for example
>
> int mouse_x = 0
> int mouse_y = 0
>
> void ProcessMouseMove()
> asm mov eax (esp+4);
> asm mov (mouse_x) eax;
> asm mov eax (esp+8);
> asm mov (mouse_y) eax
> return
>
>
> int last_key_pressed = 0
> int PAGE_UP = 33
>
> void ProcessKeyDown()
> asm mov eax (esp+4);
> asm mov (last_key_pressed) eax
> if last_key_pressed = PAGE_UP
> cdecl "green_fire.dll" ToggleFullscreen()
> end
> return
>
>
>
> void RunFrame()
> int background_color = 0
>
> background_color = background_color + 1
> cdecl "green_fire.dll" ClearFrameData(background_color);
>
> int r = 10
> for r from 10 to 250 step 3
> cdecl "green_fire.dll" DrawCircle( mouse_x, mouse_y, r, 0xff00);
> end
> cdecl "green_fire.dll" DrawSomeText2( 0xffffff, 10, 30, "this app is compiled by furia \x00");
> cdecl "green_fire.dll" DrawSomeText2( 0xffffff, 30, 130, "mouse %d %d\x00", mouse_x, mouse_y);
> return
>
> void OnResize()
> return
>
>
> void main()
> cdecl "green_fire.dll" RegisterRunFrame( &RunFrame );
> cdecl "green_fire.dll" RegisterMouseMove( &ProcessMouseMove );
> cdecl "green_fire.dll" RegisterKeyDown( &ProcessKeyDown );
> cdecl "green_fire.dll" RegisterOnResize( &OnResize );
> cdecl "green_fire.dll" SetSleepValue(30)
> cdecl "green_fire.dll" SetScaleOnResize(1)
> cdecl "green_fire.dll" SetupWindow3(" compiled by fir's furia proto c compiler \x00", 10, 10, 600, 400, 300, 200 );
> return
>
> i got a lack ov very fundamental things - one of troublesome things was
> the "compilation" (translation to assembly) free-length and free nested of
> arithmetic expressions (which may combine ints and floats also logic operators array indexing and more - even simple free arithmetic expresions on ints are troublesome for me)
>
> i got no specific question or topic for discusion for the moment but i post it an possibly i invent some if i get deeper in some problems if i again will wrap my head around it (if thay say that in english)
>
> fir
> compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
>

i wander what i can add (as this case gives some observations)

i may say that all this stetements are strightforward to translate, some just take statement and flush the piece of asm one by one linearly in one pass... no need to collect data in arrays etc... for and if only needed to store number of if/for met to use when end of for if is met to use it in flushed piece of asm (in case of for also limit of counting and step also noted

what i think is what else i could add in that very simple stream-lined approach.. i need to think what else could be added

it also makes thinking in this more complex design in languages is kinda justified (needed)..ofc its kinda needed but maybe not so much as some think... maybe i will try to insight some of it (i mean notice some things a bit more on this - what can be obtained in simple way)

other problem is i woule dlike to code something in halfway between expressions like c=a*b and unlimited nested expressions (not to torment myself with code for compiling the latter), but problem is i cant see what this halfway thing could be

also as expression mix ints and floats it seem it cant go without building a table on the fly what is int and what is float, it is quite easy ofc to build that table but i wonder what can i obtain in most simple way

expressions are pain, so maybe i will code anything else first

Re: furia (fir's proto-c compiler)

<3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21330&group=comp.lang.c#21330

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:a8d3:0:b0:69e:84e7:e35 with SMTP id r202-20020a37a8d3000000b0069e84e70e35mr11351947qke.525.1650474878236;
Wed, 20 Apr 2022 10:14:38 -0700 (PDT)
X-Received: by 2002:a05:622a:1d5:b0:2f2:161:31e5 with SMTP id
t21-20020a05622a01d500b002f2016131e5mr10118543qtw.601.1650474878000; Wed, 20
Apr 2022 10:14:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 20 Apr 2022 10:14:37 -0700 (PDT)
In-Reply-To: <20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.56; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.56
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com> <20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Wed, 20 Apr 2022 17:14:38 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 13
 by: fir - Wed, 20 Apr 2022 17:14 UTC

i updated it slightly (put 12 in link)

what i was thinking on it is to make all variables global..it gives nice cut-off of things - on compiler side when you acces variable you just need to emit a piece of assembly that uses given identifier/label and thats all, no wory of anything else..
..hovever this is a problem that you cant repeat local names even like x y or i (unless you declare them global) but for now as to proto c i think its standable

second topic is that imports, right now i precede all imported calls like

cdecl "green_fire.dll" DrawCircle( mouse_x, mouse_y, r, 0xff00);
cdecl "msvcrt.dll" printf(" dipa \x00")
stdcall " user32.dll" MessageBoxA(0,"caption\x00","title\x00",0)

to get rid of it i either would need add import "green_fire.dll" and in compiler code read into this dll build an arrays names it contains and then in my compiled code look up in this array to check what dll it possibly belongs other way is to add

import "green_fire.dll: cdecl name1, cdecl name2, cdecl name3" and this i probably will do, its not perfact but as kinda practical stub i think its standable (allows to compile without presence of dll you compile for)

Re: furia (fir's proto-c compiler)

<15b893dc-5088-4d4b-acc7-1bd1bbde113en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21331&group=comp.lang.c#21331

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:15cb:b0:2f2:681:7d06 with SMTP id d11-20020a05622a15cb00b002f206817d06mr8419914qty.386.1650476914751;
Wed, 20 Apr 2022 10:48:34 -0700 (PDT)
X-Received: by 2002:ac8:57d2:0:b0:2f1:fa23:a415 with SMTP id
w18-20020ac857d2000000b002f1fa23a415mr12068458qta.322.1650476914560; Wed, 20
Apr 2022 10:48:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 20 Apr 2022 10:48:34 -0700 (PDT)
In-Reply-To: <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.86; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.86
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com> <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <15b893dc-5088-4d4b-acc7-1bd1bbde113en@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Wed, 20 Apr 2022 17:48:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 26
 by: fir - Wed, 20 Apr 2022 17:48 UTC

środa, 20 kwietnia 2022 o 19:14:46 UTC+2 fir napisał(a):
> i updated it slightly (put 12 in link)
>
> what i was thinking on it is to make all variables global..it gives nice cut-off of things - on compiler side when you acces variable you just need to emit a piece of assembly that uses given identifier/label and thats all, no wory of anything else..
> .hovever this is a problem that you cant repeat local names even like x y or i (unless you declare them global) but for now as to proto c i think its standable
>
> second topic is that imports, right now i precede all imported calls like
> cdecl "green_fire.dll" DrawCircle( mouse_x, mouse_y, r, 0xff00);
> cdecl "msvcrt.dll" printf(" dipa \x00")
> stdcall " user32.dll" MessageBoxA(0,"caption\x00","title\x00",0)
>
> to get rid of it i either would need add import "green_fire.dll" and in compiler code read into this dll build an arrays names it contains and then in my compiled code look up in this array to check what dll it possibly belongs other way is to add
>
> import "green_fire.dll: cdecl name1, cdecl name2, cdecl name3" and this i probably will do, its not perfact but as kinda practical stub i think its standable (allows to compile without presence of dll you compile for)

incidentally the ftp site i use to upload linx stopped working (i use free one so mayb they cut me off, though it worked for years, i dont know)

Re: furia (fir's proto-c compiler)

<20220420105323.851@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21332&group=comp.lang.c#21332

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 480-992-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: furia (fir's proto-c compiler)
Date: Wed, 20 Apr 2022 17:59:14 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <20220420105323.851@kylheku.com>
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com>
<3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
Injection-Date: Wed, 20 Apr 2022 17:59:14 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="328c6955eaea4a2d6cff2d3767937281";
logging-data="4993"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19y0aH4XnYXz2lSYqnh6iTM0R+t4Jr0l8A="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:yX1B/4dx65wfqqCMz/3Dh1+eLf0=
 by: Kaz Kylheku - Wed, 20 Apr 2022 17:59 UTC

On 2022-04-20, fir <profesor.fir@gmail.com> wrote:
> i updated it slightly (put 12 in link)
>
> what i was thinking on it is to make all variables global..it gives
> nice cut-off of things - on compiler side when you acces variable you
> just need to emit a piece of assembly that uses given identifier/label
> and thats all, no wory of anything else.. .hovever this is a problem
> that you cant repeat local names even like x y or i (unless you
> declare them global) but for now as to proto c i think its standable

That is false. You can have locally scoped variables that are globally
accessed via names at the assembly language level.

You just have to allocate machine-generated names for them, and map from
the declared names to the machine-generated names.

Have you heard of this declaration specifier called static? E.g

static int x;
{
static int x;

}

this could compile to something like: the outer x is $g0027
and the inner x is $g0028.

The disadvantage of global/static variables isn't that you cannot
reuse names, but that you don't have reentrancy. Even under
simple recursion, you have to save and restore important
variables. (And where to? You need a stack for that.)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: furia (fir's proto-c compiler)

<49d66cbd-65f8-45fd-a6df-1eeaeed254c2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21333&group=comp.lang.c#21333

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5812:0:b0:2f1:f94e:68d6 with SMTP id g18-20020ac85812000000b002f1f94e68d6mr12989828qtg.173.1650478578933;
Wed, 20 Apr 2022 11:16:18 -0700 (PDT)
X-Received: by 2002:ad4:5947:0:b0:446:4c6a:32d0 with SMTP id
eo7-20020ad45947000000b004464c6a32d0mr14496382qvb.131.1650478578813; Wed, 20
Apr 2022 11:16:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 20 Apr 2022 11:16:18 -0700 (PDT)
In-Reply-To: <20220420105323.851@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.86; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.86
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com> <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
<20220420105323.851@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <49d66cbd-65f8-45fd-a6df-1eeaeed254c2n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Wed, 20 Apr 2022 18:16:18 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 83
 by: fir - Wed, 20 Apr 2022 18:16 UTC

środa, 20 kwietnia 2022 o 19:59:27 UTC+2 Kaz Kylheku napisał(a):
> On 2022-04-20, fir <profes...@gmail.com> wrote:
> > i updated it slightly (put 12 in link)
> >
> > what i was thinking on it is to make all variables global..it gives
> > nice cut-off of things - on compiler side when you acces variable you
> > just need to emit a piece of assembly that uses given identifier/label
> > and thats all, no wory of anything else.. .hovever this is a problem
> > that you cant repeat local names even like x y or i (unless you
> > declare them global) but for now as to proto c i think its standable
> That is false. You can have locally scoped variables that are globally
> accessed via names at the assembly language level.
>
> You just have to allocate machine-generated names for them, and map from
> the declared names to the machine-generated names.
>
> Have you heard of this declaration specifier called static? E.g
>
> static int x;
> {
> static int x;
>
>
> }
>
> this could compile to something like: the outer x is $g0027
> and the inner x is $g0028.
>
> The disadvantage of global/static variables isn't that you cannot
> reuse names, but that you don't have reentrancy. Even under
> simple recursion, you have to save and restore important
> variables. (And where to? You need a stack for that.)
>
i dont quite understand what you mean
whay i meen is i that if i make all variables global - even those who are scoped in function body,
and even those who are function arguments, like

int x;
void foo(int y, int z)
{ int w;
}

simply be like
int x;
int y;
int z;
int w;

- this makes nice "cut off" in simplicity of compiler becouse i dont need check literally
nothing ... when i encounted declaration like above i just emit

..data x (int)

(which my assembler just assembles by reserving adres in statioc data section and thats all)
and when i found acces like x=2 i also need to emit just two lines of blind assembly

mov eax 2
mov (x) eax

and dont bother for nothing..it simply makes it dat simple...this is not handy (as it not allows to reuse names) but it ois possible to write programs this way.. one may just declare global int i and reuse it in all loops or sometimes make convention that for example will put functionname_variable name to not make clash (the first just reuse is probably standable as kinda by definition that local names you use in normal c are not meant to preserve value)

as to recursion i dont care it is so rarely used i literally use it once a 10 years and could live without it
(also note im writing proto-c compiler when i realize some stages i will revrite it bot for given 'milestones' i kinda find it interesting to hold to some simplifications - and the question is qhat simplifications are good compromise for very strong simplicity and standable usability)

Re: furia (fir's proto-c compiler)

<a8d7eadf-a060-4e93-ad3f-1627f09745a7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21334&group=comp.lang.c#21334

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2886:b0:699:bab7:ae78 with SMTP id j6-20020a05620a288600b00699bab7ae78mr13334044qkp.618.1650479346431;
Wed, 20 Apr 2022 11:29:06 -0700 (PDT)
X-Received: by 2002:a05:620a:348:b0:69e:a0f1:cb8b with SMTP id
t8-20020a05620a034800b0069ea0f1cb8bmr9350191qkm.151.1650479346285; Wed, 20
Apr 2022 11:29:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 20 Apr 2022 11:29:06 -0700 (PDT)
In-Reply-To: <49d66cbd-65f8-45fd-a6df-1eeaeed254c2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.86; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.86
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com> <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
<20220420105323.851@kylheku.com> <49d66cbd-65f8-45fd-a6df-1eeaeed254c2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a8d7eadf-a060-4e93-ad3f-1627f09745a7n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Wed, 20 Apr 2022 18:29:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 95
 by: fir - Wed, 20 Apr 2022 18:29 UTC

środa, 20 kwietnia 2022 o 20:16:26 UTC+2 fir napisał(a):
> środa, 20 kwietnia 2022 o 19:59:27 UTC+2 Kaz Kylheku napisał(a):
> > On 2022-04-20, fir <profes...@gmail.com> wrote:
> > > i updated it slightly (put 12 in link)
> > >
> > > what i was thinking on it is to make all variables global..it gives
> > > nice cut-off of things - on compiler side when you acces variable you
> > > just need to emit a piece of assembly that uses given identifier/label
> > > and thats all, no wory of anything else.. .hovever this is a problem
> > > that you cant repeat local names even like x y or i (unless you
> > > declare them global) but for now as to proto c i think its standable
> > That is false. You can have locally scoped variables that are globally
> > accessed via names at the assembly language level.
> >
> > You just have to allocate machine-generated names for them, and map from
> > the declared names to the machine-generated names.
> >
> > Have you heard of this declaration specifier called static? E.g
> >
> > static int x;
> > {
> > static int x;
> >
> >
> > }
> >
> > this could compile to something like: the outer x is $g0027
> > and the inner x is $g0028.
> >
> > The disadvantage of global/static variables isn't that you cannot
> > reuse names, but that you don't have reentrancy. Even under
> > simple recursion, you have to save and restore important
> > variables. (And where to? You need a stack for that.)
> >
> i dont quite understand what you mean
> whay i meen is i that if i make all variables global - even those who are scoped in function body,
> and even those who are function arguments, like
>
> int x;
> void foo(int y, int z)
> {
> int w;
> }
>
> simply be like
> int x;
> int y;
> int z;
> int w;
>
> - this makes nice "cut off" in simplicity of compiler becouse i dont need check literally
> nothing ... when i encounted declaration like above i just emit
>
> .data x (int)
>
> (which my assembler just assembles by reserving adres in statioc data section and thats all)
> and when i found acces like x=2 i also need to emit just two lines of blind assembly
>
> mov eax 2
> mov (x) eax
>
> and dont bother for nothing..it simply makes it dat simple...this is not handy (as it not allows to reuse names) but it ois possible to write programs this way.. one may just declare global int i and reuse it in all loops or sometimes make convention that for example will put functionname_variable name to not make clash (the first just reuse is probably standable as kinda by definition that local names you use in normal c are not meant to preserve value)
>
> as to recursion i dont care it is so rarely used i literally use it once a 10 years and could live without it
> (also note im writing proto-c compiler when i realize some stages i will revrite it bot for given 'milestones' i kinda find it interesting to hold to some simplifications - and the question is qhat simplifications are good compromise for very strong simplicity and standable usability)

as what you probbaly say i know it i may just add functionname__ prefix (making functionname_x) before locals and arguments and in case of compiling x check if functionname_x is present and if so emit functionname_x it is standably easy (its very wasy in fact) but i wanted this "total globalisation" more for sake of it than that i cant handle that prefixing - prefixin i always can do, so its not matter maybe of ding it but the order of doing this...and i need yet to compile that damn nested expressions and some side things i yet not even thinkd

Re: furia (fir's proto-c compiler)

<0de1b8ac-505a-49fd-a2e4-77371ea7497fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21335&group=comp.lang.c#21335

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:191:b0:2f1:ffe6:283c with SMTP id s17-20020a05622a019100b002f1ffe6283cmr10417931qtw.557.1650479926134;
Wed, 20 Apr 2022 11:38:46 -0700 (PDT)
X-Received: by 2002:a05:620a:20c2:b0:69e:6ef0:7aaf with SMTP id
f2-20020a05620a20c200b0069e6ef07aafmr13551156qka.187.1650479926002; Wed, 20
Apr 2022 11:38:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 20 Apr 2022 11:38:45 -0700 (PDT)
In-Reply-To: <a8d7eadf-a060-4e93-ad3f-1627f09745a7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.86; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.86
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com> <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
<20220420105323.851@kylheku.com> <49d66cbd-65f8-45fd-a6df-1eeaeed254c2n@googlegroups.com>
<a8d7eadf-a060-4e93-ad3f-1627f09745a7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0de1b8ac-505a-49fd-a2e4-77371ea7497fn@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Wed, 20 Apr 2022 18:38:46 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 205
 by: fir - Wed, 20 Apr 2022 18:38 UTC

as those zip links dont work i may put the source it compiles in this example and teh assembly
it generates (if someone would read into it i think it may be somewhat educational )

the proto-c code

void ProcessMouseMove(int mouse_x, int mouse_y)
return

void ProcessKeyDown(int last_key_pressed)
int PAGE_UP = 33
if last_key_pressed = PAGE_UP
cdecl "green_fire.dll" ToggleFullscreen()
end
return

void RollBackgroundColor()
int background_color = 0
background_color = background_color + 1
cdecl "green_fire.dll" ClearFrameData(background_color);
return

void RunFrame()
RollBackgroundColor()
int r = 10
for r from 10 to 250 step 3
cdecl "green_fire.dll" DrawCircle( mouse_x, mouse_y, r, 0xff00);
end
cdecl "green_fire.dll" DrawSomeText2( 0xffffff, 10, 30, "this app is compiled by furia \x00");
cdecl "green_fire.dll" DrawSomeText2( 0xffffff, 30, 130, "mouse %d %d\x00", mouse_x, mouse_y);
return

void OnResize()
return

void main()
cdecl "green_fire.dll" RegisterRunFrame( &RunFrame );
cdecl "green_fire.dll" RegisterMouseMove( &ProcessMouseMove );
cdecl "green_fire.dll" RegisterKeyDown( &ProcessKeyDown );
cdecl "green_fire.dll" RegisterOnResize( &OnResize );
cdecl "green_fire.dll" SetSleepValue(30)
cdecl "green_fire.dll" SetScaleOnResize(1)
cdecl "green_fire.dll" SetupWindow3(" compiled by fir's furia proto c compiler \x00", 10, 10, 600, 400, 300, 200 );
return

emited asm (im my own syntax fpr example by ?? i denote data directive to declare data (i also allowed it to intermix it with code not like some assemblers who keep .code and .data directives in separate)

// this is assembly generated by fir's furia compiler
// at Apr 20 2022 18:46:17
// use organic assembler to assemble it into exe

jmp main

ProcessMouseMove:
?? mouse_x: 0i
mov eax (esp+4)
mov (mouse_x) eax
?? mouse_y: 0i
mov eax (esp+8)
mov (mouse_y) eax

ret

ProcessKeyDown:
?? last_key_pressed: 0i
mov eax (esp+4)
mov (last_key_pressed) eax
?? PAGE_UP: 33i

mov eax (last_key_pressed)
cmp eax (PAGE_UP)
jne __if__0__end

call ("green_fire.dll"->ToggleFullscreen)
__if__0__end:

ret

RollBackgroundColor:
?? background_color: 0i
mov eax (background_color)
add eax 1
mov (background_color) eax

push (background_color)
call ("green_fire.dll"->ClearFrameData)
pop eax

ret

RunFrame:

call RollBackgroundColor
?? r: 10i

// compiling for r from 10 to 250 step 3

mov ecx 10
__for__0__start:
push ecx
mov (r) ecx

push 65280
push (r)
push (mouse_y)
push (mouse_x)
call ("green_fire.dll"->DrawCircle)
pop eax
pop eax
pop eax
pop eax

pop ecx
add ecx 3
cmp ecx 251
jl __for__0__start

?? str_label_0: "this app is compiled by furia \x00"
push str_label_0
push 30
push 10
push 16777215
call ("green_fire.dll"->DrawSomeText2)
pop eax
pop eax
pop eax
pop eax

push (mouse_y)
push (mouse_x)
?? str_label_1: "mouse %d %d\x00"
push str_label_1
push 130
push 30
push 16777215
call ("green_fire.dll"->DrawSomeText2)
pop eax
pop eax
pop eax
pop eax
pop eax
pop eax

ret

OnResize:

ret

main:

push RunFrame
call ("green_fire.dll"->RegisterRunFrame)
pop eax

push ProcessMouseMove
call ("green_fire.dll"->RegisterMouseMove)
pop eax

push ProcessKeyDown
call ("green_fire.dll"->RegisterKeyDown)
pop eax

push OnResize
call ("green_fire.dll"->RegisterOnResize)
pop eax

push 30
call ("green_fire.dll"->SetSleepValue)
pop eax

push 1
call ("green_fire.dll"->SetScaleOnResize)
pop eax

push 200
push 300
push 400
push 600
push 10
push 10
?? str_label_2: " compiled by fir's furia proto c compiler \x00"
push str_label_2
call ("green_fire.dll"->SetupWindow3)
pop eax
pop eax
pop eax
pop eax
pop eax
pop eax
pop eax

ret

Re: furia (fir's proto-c compiler)

<c1dcecc0-2abc-4a1d-81fa-05b1113ba116n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21340&group=comp.lang.c#21340

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:110a:0:b0:2f1:ea84:b84 with SMTP id c10-20020ac8110a000000b002f1ea840b84mr15043690qtj.463.1650486251426;
Wed, 20 Apr 2022 13:24:11 -0700 (PDT)
X-Received: by 2002:ad4:5be1:0:b0:430:c99:8a87 with SMTP id
k1-20020ad45be1000000b004300c998a87mr16755599qvc.82.1650486251261; Wed, 20
Apr 2022 13:24:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 20 Apr 2022 13:24:11 -0700 (PDT)
In-Reply-To: <0de1b8ac-505a-49fd-a2e4-77371ea7497fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.2; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.2
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com> <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
<20220420105323.851@kylheku.com> <49d66cbd-65f8-45fd-a6df-1eeaeed254c2n@googlegroups.com>
<a8d7eadf-a060-4e93-ad3f-1627f09745a7n@googlegroups.com> <0de1b8ac-505a-49fd-a2e4-77371ea7497fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c1dcecc0-2abc-4a1d-81fa-05b1113ba116n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Wed, 20 Apr 2022 20:24:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 19
 by: fir - Wed, 20 Apr 2022 20:24 UTC

i may yet share some side thought i noticed yesterday (as this is discussion goroup and that thoughts are suitable for discussion groups i think)
what i genarate with thic compilation is a vwry simple assembly, in fact i even could generate allembly that uses only eax ;c (and esp sporadically) no other registers - though i may add some also
this assembly that uses only eax may be overprimitive but eventually i could generate a bit better that uses more registers but still it wouldnt be nothing elabiorate like those heavily optimised assembly outputs that are generated for specific models of x86 family

the quesrtion is if people SHOULD generate such elaborate optimised assembly outputs..in fact it seem to me that most probably NO...assembly should be imo rather most clean and strightforward and if talking of optimisation it could be rather more for size (shortnmess( and clarity

its probably cpu designers that should optimise, the fact that compiler optimise in different ways for different mnodels is rather fault (not that i bother on details how it today look assembly level of cpus, 20 years ago it seemd interesting to me but now seem things seem to changed..kinda sad as this golden era computing i remember the best)

Re: furia (fir's proto-c compiler)

<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21348&group=comp.lang.c#21348

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:1c49:b0:446:586e:8b86 with SMTP id if9-20020a0562141c4900b00446586e8b86mr15080569qvb.85.1650546671972;
Thu, 21 Apr 2022 06:11:11 -0700 (PDT)
X-Received: by 2002:ad4:5be1:0:b0:430:c99:8a87 with SMTP id
k1-20020ad45be1000000b004300c998a87mr18972294qvc.82.1650546671801; Thu, 21
Apr 2022 06:11:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 06:11:11 -0700 (PDT)
In-Reply-To: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.192.51.129; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 80.192.51.129
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: bart4...@gmail.com (bart c)
Injection-Date: Thu, 21 Apr 2022 13:11:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: bart c - Thu, 21 Apr 2022 13:11 UTC

On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:

> fir
> compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
>
> http://minddetonator.htw.pl/furia11.zip

My OS said this ZIP was unsafe. When I bypassed that, all it contained was a PDF of a slide, in Polish, containing some bullet points.

Is that as far as you got?

Re: furia (fir's proto-c compiler)

<1bo80ua1aj.fsf@pfeifferfamily.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21352&group=comp.lang.c#21352

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: pfeif...@cs.nmsu.edu (Joe Pfeiffer)
Newsgroups: comp.lang.c
Subject: Re: furia (fir's proto-c compiler)
Date: Thu, 21 Apr 2022 09:44:52 -0600
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <1bo80ua1aj.fsf@pfeifferfamily.net>
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="1bf072c1e9c84786e968e2589612bf85";
logging-data="14360"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18u5EaiZ/wUp9rn7GXG5uAXhqoGp9SNJlQ="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:+grJStpWYiy+eEwYVh/uU6nluVk=
sha1:QzrmfzNpaYIvDijHlNrR3/dpUik=
 by: Joe Pfeiffer - Thu, 21 Apr 2022 15:44 UTC

bart c <bart4858@gmail.com> writes:

> On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
>
>> fir
>> compiler for test (worx on windows, as i generaty my own exe and i
>> not fulfilled for some PE standards or so some antivirs may raport
>> false alarmn that gnerated exe is a virus..its not)
>>
>> http://minddetonator.htw.pl/furia11.zip
>
> My OS said this ZIP was unsafe. When I bypassed that, all it contained
> was a PDF of a slide, in Polish, containing some bullet points.
>
> Is that as far as you got?

I got a 403 when I tried to download it.

Re: furia (fir's proto-c compiler)

<78862493-8399-489a-a69e-09e2fbce936an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21353&group=comp.lang.c#21353

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2683:b0:69c:8c9c:5f80 with SMTP id c3-20020a05620a268300b0069c8c9c5f80mr84966qkp.367.1650557261224;
Thu, 21 Apr 2022 09:07:41 -0700 (PDT)
X-Received: by 2002:ad4:5be1:0:b0:430:c99:8a87 with SMTP id
k1-20020ad45be1000000b004300c998a87mr423303qvc.82.1650557260993; Thu, 21 Apr
2022 09:07:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 09:07:40 -0700 (PDT)
In-Reply-To: <42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.160; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.160
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com> <42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <78862493-8399-489a-a69e-09e2fbce936an@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 16:07:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 21
 by: fir - Thu, 21 Apr 2022 16:07 UTC

czwartek, 21 kwietnia 2022 o 15:11:19 UTC+2 bart c napisał(a):
> On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
>
> > fir
> > compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
> >
> > http://minddetonator.htw.pl/furia11.zip
> My OS said this ZIP was unsafe. When I bypassed that, all it contained was a PDF of a slide, in Polish, containing some bullet points.
>
> Is that as far as you got?

i noticed i needed not to click on this here but to copy and paset it in adres field of browser and it worked - untin next day it stoped working at all (i suspecty that this site which i use as ftp to put various files i link maybe decided to turn it off for me as they will prefer if i put calasic www page there and thay can show ugly advertisments)

if you know some page i may put this 200 KB zip to download say and i may upload there)

Re: furia (fir's proto-c compiler)

<3286c819-dfe0-4084-bdd0-a7717e7de8d7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21354&group=comp.lang.c#21354

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1d5:b0:2f2:161:31e5 with SMTP id t21-20020a05622a01d500b002f2016131e5mr131142qtw.601.1650557596432;
Thu, 21 Apr 2022 09:13:16 -0700 (PDT)
X-Received: by 2002:a37:5e44:0:b0:69e:9f75:cba3 with SMTP id
s65-20020a375e44000000b0069e9f75cba3mr95427qkb.519.1650557596228; Thu, 21 Apr
2022 09:13:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 09:13:15 -0700 (PDT)
In-Reply-To: <1bo80ua1aj.fsf@pfeifferfamily.net>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.160; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.160
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <1bo80ua1aj.fsf@pfeifferfamily.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3286c819-dfe0-4084-bdd0-a7717e7de8d7n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 16:13:16 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 23
 by: fir - Thu, 21 Apr 2022 16:13 UTC

czwartek, 21 kwietnia 2022 o 17:45:06 UTC+2 Joe Pfeiffer napisał(a):
> bart c <bart...@gmail.com> writes:
>
> > On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
> >
> >> fir
> >> compiler for test (worx on windows, as i generaty my own exe and i
> >> not fulfilled for some PE standards or so some antivirs may raport
> >> false alarmn that gnerated exe is a virus..its not)
> >>
> >> http://minddetonator.htw.pl/furia11.zip
> >
> > My OS said this ZIP was unsafe. When I bypassed that, all it contained
> > was a PDF of a slide, in Polish, containing some bullet points.
> >
> > Is that as far as you got?
> I got a 403 when I tried to download it.

yuh, sorry - it worked for me 10 years or so but it was a day when it stopped working (i still got acces to ftp in total commender but links dont work now,)
if some know site to upload zip i may use it but say me which one

Re: furia (fir's proto-c compiler)

<84c133e4-d1fa-4c50-8b80-7ffeacb92c56n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21355&group=comp.lang.c#21355

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:e88:b0:446:383a:62ec with SMTP id hf8-20020a0562140e8800b00446383a62ecmr245008qvb.68.1650558474275;
Thu, 21 Apr 2022 09:27:54 -0700 (PDT)
X-Received: by 2002:a05:6214:1c83:b0:443:6749:51f8 with SMTP id
ib3-20020a0562141c8300b00443674951f8mr501767qvb.74.1650558473172; Thu, 21 Apr
2022 09:27:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 09:27:52 -0700 (PDT)
In-Reply-To: <78862493-8399-489a-a69e-09e2fbce936an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.160; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.160
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <78862493-8399-489a-a69e-09e2fbce936an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <84c133e4-d1fa-4c50-8b80-7ffeacb92c56n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 16:27:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 28
 by: fir - Thu, 21 Apr 2022 16:27 UTC

czwartek, 21 kwietnia 2022 o 18:07:48 UTC+2 fir napisał(a):
> czwartek, 21 kwietnia 2022 o 15:11:19 UTC+2 bart c napisał(a):
> > On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
> >
> > > fir
> > > compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
> > >
> > > http://minddetonator.htw.pl/furia11.zip
> > My OS said this ZIP was unsafe. When I bypassed that, all it contained was a PDF of a slide, in Polish, containing some bullet points.
> >
> > Is that as far as you got?
> i noticed i needed not to click on this here but to copy and paset it in adres field of browser and it worked - untin next day it stoped working at all (i suspecty that this site which i use as ftp to put various files i link maybe decided to turn it off for me as they will prefer if i put calasic www page there and thay can show ugly advertisments)
>
> if you know some page i may put this 200 KB zip to download say and i may upload there)

admin answered to me "Mechanizmy bezpieczeństwa google - safe browser uznały, że strona zawiera szkodliwe skrypty." which stands for probably "The google - safe browser security mechanisms have decided that the website contains malicious scripts."

dont you know what i can do with this?

Re: furia (fir's proto-c compiler)

<a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21356&group=comp.lang.c#21356

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:6115:b0:2f1:d8fa:84aa with SMTP id hg21-20020a05622a611500b002f1d8fa84aamr235408qtb.689.1650559224609;
Thu, 21 Apr 2022 09:40:24 -0700 (PDT)
X-Received: by 2002:a0c:c1cf:0:b0:446:e99:8ac6 with SMTP id
v15-20020a0cc1cf000000b004460e998ac6mr543327qvh.130.1650559224457; Thu, 21
Apr 2022 09:40:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 09:40:24 -0700 (PDT)
In-Reply-To: <42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.160; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.160
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com> <42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 16:40:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 26
 by: fir - Thu, 21 Apr 2022 16:40 UTC

czwartek, 21 kwietnia 2022 o 15:11:19 UTC+2 bart c napisał(a):
> On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
>
> > fir
> > compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
> >
> > http://minddetonator.htw.pl/furia11.zip
> My OS said this ZIP was unsafe. When I bypassed that, all it contained was a PDF of a slide, in Polish, containing some bullet points.
>
> Is that as far as you got?

ok try this

https://file.io/s39Qw9YoC8OK

this is a protocompiler and my assembler (and my dll library something like sfml/sdl i wrote for my own usage) ..i didnt spend a lot of time on both - the 'gross' of the work was writing the assembler which i already wrote on - the 'gross' of thios work on assembler was two weeks of work, (but after half a year of being slightly stunned by pe format) the work on compiler was even shorter (like week of work - speaking maybe a bit in reduced way as i dont remember correctly but thas was this type of amounts - not included resting and time for thinking ;c)

Re: furia (fir's proto-c compiler)

<ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21357&group=comp.lang.c#21357

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:24c5:b0:69e:e777:4323 with SMTP id m5-20020a05620a24c500b0069ee7774323mr297897qkn.465.1650561418099;
Thu, 21 Apr 2022 10:16:58 -0700 (PDT)
X-Received: by 2002:a05:622a:9:b0:2f1:e9d7:d734 with SMTP id
x9-20020a05622a000900b002f1e9d7d734mr393922qtw.476.1650561417872; Thu, 21 Apr
2022 10:16:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 10:16:57 -0700 (PDT)
In-Reply-To: <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.184; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.184
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 17:16:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 41
 by: fir - Thu, 21 Apr 2022 17:16 UTC

czwartek, 21 kwietnia 2022 o 18:40:31 UTC+2 fir napisał(a):
> czwartek, 21 kwietnia 2022 o 15:11:19 UTC+2 bart c napisał(a):
> > On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
> >
> > > fir
> > > compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
> > >
> > > http://minddetonator.htw.pl/furia11.zip
> > My OS said this ZIP was unsafe. When I bypassed that, all it contained was a PDF of a slide, in Polish, containing some bullet points.
> >
> > Is that as far as you got?
> ok try this
>
> https://file.io/s39Qw9YoC8OK
>
> this is a protocompiler and my assembler (and my dll library something like sfml/sdl i wrote for my own usage) ..i didnt spend a lot of time on both - the 'gross' of the work was writing the assembler which i already wrote on - the 'gross' of thios work on assembler was two weeks of work, (but after half a year of being slightly stunned by pe format) the work on compiler was even shorter (like week of work - speaking maybe a bit in reduced way as i dont remember correctly but thas was this type of amounts - not included resting and time for thinking ;c)

here also,

https://filebin.net/u9hkfyr8llptnwj3#

i post it in case of somebody would like to discuss related things as its kinda interesting in fact for example i discovered that the compiler is in fact like 20 maybe 30 lines of code - you only need to add next lines to compile next functionalities

problem is i recantli like have lack of motivation and even though i could upbuild the compiler to compile reasonable c and more i find this lack of motivation (in fact maybe im getting old ..especially this eyesight makes a problem)

Re: furia (fir's proto-c compiler)

<cc30eb49-19d7-47e7-aafe-1828812b3b1bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21358&group=comp.lang.c#21358

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:c3:b0:2e3:4bd0:16c2 with SMTP id p3-20020a05622a00c300b002e34bd016c2mr372324qtw.575.1650561895251;
Thu, 21 Apr 2022 10:24:55 -0700 (PDT)
X-Received: by 2002:ac8:7d0c:0:b0:2f3:4433:37f2 with SMTP id
g12-20020ac87d0c000000b002f3443337f2mr427556qtb.404.1650561895068; Thu, 21
Apr 2022 10:24:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 10:24:54 -0700 (PDT)
In-Reply-To: <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.192.51.129; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 80.192.51.129
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cc30eb49-19d7-47e7-aafe-1828812b3b1bn@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: bart4...@gmail.com (bart c)
Injection-Date: Thu, 21 Apr 2022 17:24:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 30
 by: bart c - Thu, 21 Apr 2022 17:24 UTC

On Thursday, 21 April 2022 at 17:40:31 UTC+1, fir wrote:
> czwartek, 21 kwietnia 2022 o 15:11:19 UTC+2 bart c napisał(a):
> > On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
> >
> > > fir
> > > compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
> > >
> > > http://minddetonator.htw.pl/furia11.zip
> > My OS said this ZIP was unsafe. When I bypassed that, all it contained was a PDF of a slide, in Polish, containing some bullet points.
> >
> > Is that as far as you got?
> ok try this
>
> https://file.io/s39Qw9YoC8OK
>
> this is a protocompiler and my assembler (and my dll library something like sfml/sdl i wrote for my own usage) ..i didnt spend a lot of time on both - the 'gross' of the work was writing the assembler which i already wrote on - the 'gross' of thios work on assembler was two weeks of work, (but after half a year of being slightly stunned by pe format) the work on compiler was even shorter (like week of work - speaking maybe a bit in reduced way as i dont remember correctly but thas was this type of amounts - not included resting and time for thinking ;c)

This worked. Already it did say the file would be deleted after downloading (you may need to re-upload?).

The two EXEs worked fine this time, and that was pretty good demo.

Re: furia (fir's proto-c compiler)

<92d1ebf1-9cf0-4873-bf0a-a8b029ad5787n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21359&group=comp.lang.c#21359

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:110a:0:b0:2f1:ea84:b84 with SMTP id c10-20020ac8110a000000b002f1ea840b84mr449937qtj.463.1650563336831;
Thu, 21 Apr 2022 10:48:56 -0700 (PDT)
X-Received: by 2002:ad4:5947:0:b0:446:4c6a:32d0 with SMTP id
eo7-20020ad45947000000b004464c6a32d0mr434439qvb.131.1650563336677; Thu, 21
Apr 2022 10:48:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 10:48:56 -0700 (PDT)
In-Reply-To: <ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.98; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.98
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
<ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <92d1ebf1-9cf0-4873-bf0a-a8b029ad5787n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 17:48:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 75
 by: fir - Thu, 21 Apr 2022 17:48 UTC

czwartek, 21 kwietnia 2022 o 19:17:05 UTC+2 fir napisał(a):
>
> i post it in case of somebody would like to discuss related things as its kinda interesting in fact for example i discovered that the compiler is in fact like 20 maybe 30 lines of code - you only need to add next lines to compile next functionalities
>

wanna see that lines? it is

FILE *out_asm_file = NULL ;

int main(int argc, char* argv[])
{ char* input_file_name = "program.c"; char* output_file_name = "program.asm";
if (argc==3) { input_file_name = argv[1]; output_file_name = argv[2]; }
chunk d = LoadChunk(input_file_name);
out_asm_file = fopen(output_file_name, "wb");

chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');
int n = ChunksLength(lines);
for(int i=0; i<n; i++) {
if(ChunkIsEmpty(lines.first[i])) continue;
chunks atoms = SplitChunkOnAtoms(current_line);
int atoms_len = ChunksLength(atoms);
if(atoms_len<1) continue; //skip emty lines
if( atoms_len>=2 ) if( CCS(a0, "/") ) if( CCS(a1, "/") ) continue; //skip commentary lines
if(atoms_len>=4) // compile aaa+=222
if( CCL (a0) ) if( CCS (a1, "+") ) if( CCS (a2, "=") ) if( CCI (a3) ) {
FlushOutAsmChunkPE("\n mov eax (", a0, ")");
FlushOutAsmChunkPE("\n add eax ", a3, " ");
FlushOutAsmChunkPE("\n mov (", a0, ") eax "); }

if(atoms_len>=6) //compile tab[a] = b
{ if( CCL( a0 ) ) if( CCS( a1, "[" ) ) if( CCL( a2 ) ) if( CCS( a3, "]" ) ) if( CCS( a4, "=" ) ) if( CCL( a5 ) )
{
FlushOutAsmChunkPE("\n mov ebx (", a5, ") ");
FlushOutAsmChunkPE("\n mov eax ", a0, " ");
FlushOutAsmChunkPE("\n add eax (", a2, ") ");
FlushOutAsmChunkPE("\n mov (eax) ebx ", Chunk(" "), " ");
continue;
}
}
if(atoms_len >= 5) // compile stdcall "modulename" foo()
{
if( CCS(a0, "stdcall") || CCS(a0, "cdecl")) if( CCS(a1, "\"" ) ) if( CCL(a2) ) if( CCS(a3, "." ) ) if( CCL(a4) ) if( CCS(a5, "\"" ) ) if( CCL(a6) ) {
FlushOutAsm("\n ");
int args_len = GenerateOPushesForArgumentsOfFunction( current_line);
FlushOutAsm("\n call (\"%.*s.%.*s\"->%.*s) ", ChunkLength(a2) , a2.beg, ChunkLength(a4) , a4.beg, ChunkLength(a6) , a6.beg );
if( CCS(a0, "cdecl") )
for(int i=args_len-1; i>=0; i--) { FlushOutAsm("\n pop eax "); }
}
}

/////
rest here
/////
} fclose(out_asm_file);
printf("\n COMPILATION DONE ");
return 0;
}

done, compiler written

Re: furia (fir's proto-c compiler)

<6b4f1b8d-1777-4ef7-8543-d71e3d9acd60n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21360&group=comp.lang.c#21360

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:d48:b0:446:3a33:2dba with SMTP id 8-20020a0562140d4800b004463a332dbamr486857qvr.78.1650563342230;
Thu, 21 Apr 2022 10:49:02 -0700 (PDT)
X-Received: by 2002:a37:aec6:0:b0:69b:f82c:7704 with SMTP id
x189-20020a37aec6000000b0069bf82c7704mr409133qke.362.1650563342047; Thu, 21
Apr 2022 10:49:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 10:49:01 -0700 (PDT)
In-Reply-To: <cc30eb49-19d7-47e7-aafe-1828812b3b1bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.98; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.98
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
<cc30eb49-19d7-47e7-aafe-1828812b3b1bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6b4f1b8d-1777-4ef7-8543-d71e3d9acd60n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 17:49:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 75
 by: fir - Thu, 21 Apr 2022 17:49 UTC

czwartek, 21 kwietnia 2022 o 19:25:03 UTC+2 bart c napisał(a):
> On Thursday, 21 April 2022 at 17:40:31 UTC+1, fir wrote:
> > czwartek, 21 kwietnia 2022 o 15:11:19 UTC+2 bart c napisał(a):
> > > On Tuesday, 19 April 2022 at 22:00:34 UTC+1, fir wrote:
> > >
> > > > fir
> > > > compiler for test (worx on windows, as i generaty my own exe and i not fulfilled for some PE standards or so some antivirs may raport false alarmn that gnerated exe is a virus..its not)
> > > >
> > > > http://minddetonator.htw.pl/furia11.zip
> > > My OS said this ZIP was unsafe. When I bypassed that, all it contained was a PDF of a slide, in Polish, containing some bullet points.
> > >
> > > Is that as far as you got?
> > ok try this
> >
> > https://file.io/s39Qw9YoC8OK
> >
> > this is a protocompiler and my assembler (and my dll library something like sfml/sdl i wrote for my own usage) ..i didnt spend a lot of time on both - the 'gross' of the work was writing the assembler which i already wrote on - the 'gross' of thios work on assembler was two weeks of work, (but after half a year of being slightly stunned by pe format) the work on compiler was even shorter (like week of work - speaking maybe a bit in reduced way as i dont remember correctly but thas was this type of amounts - not included resting and time for thinking ;c)
> This worked. Already it did say the file would be deleted after downloading (you may need to re-upload?).
>
> The two EXEs worked fine this time, and that was pretty good demo.

this demo you like probebly becouse my green fire dll which allows do some easy window
pixelbased apps

you could use it in c like

#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN
#include <windows.h>
#include <math.h>
#include "green-fire.h"

void RunFrame(int advance)
{ ClearFrameData(0x333300);
//draw here

///code here , may poll keyboard and draw by DrawLine DrawCircle
if(space_pressed) {}

}

void ProcessMouseMove(int x, int y)
{ //mouse movement event
}

void ProcessKeyDown(int key) {
if(key==VK_UP ) { } ///key events
}

void OnResize() {}

int main(void)
{ RegisterMouseMove( ProcessMouseMove ); //set callbacks
RegisterKeyDown( ProcessKeyDown );
RegisterOnResize( OnResize );
RegisterRunFrame( RunFrame );
SetSleepValue(12);
SetupWindow2(" my app ", 20, 20, 700/1, 500/1 );
return 0;
}

Re: furia (fir's proto-c compiler)

<0e0778c3-4830-4bc7-868a-8ec2c4d5194dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21361&group=comp.lang.c#21361

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:2415:b0:69e:784d:3a4c with SMTP id d21-20020a05620a241500b0069e784d3a4cmr472677qkn.14.1650564607525;
Thu, 21 Apr 2022 11:10:07 -0700 (PDT)
X-Received: by 2002:ac8:7387:0:b0:2f1:eb13:ceb2 with SMTP id
t7-20020ac87387000000b002f1eb13ceb2mr525347qtp.51.1650564607374; Thu, 21 Apr
2022 11:10:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 11:10:07 -0700 (PDT)
In-Reply-To: <92d1ebf1-9cf0-4873-bf0a-a8b029ad5787n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.98; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.98
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
<ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com> <92d1ebf1-9cf0-4873-bf0a-a8b029ad5787n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0e0778c3-4830-4bc7-868a-8ec2c4d5194dn@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 18:10:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 143
 by: fir - Thu, 21 Apr 2022 18:10 UTC

czwartek, 21 kwietnia 2022 o 19:49:03 UTC+2 fir napisał(a):
> czwartek, 21 kwietnia 2022 o 19:17:05 UTC+2 fir napisał(a):
> >
> > i post it in case of somebody would like to discuss related things as its kinda interesting in fact for example i discovered that the compiler is in fact like 20 maybe 30 lines of code - you only need to add next lines to compile next functionalities
> >
> wanna see that lines? it is
>
> FILE *out_asm_file = NULL ;
>
> int main(int argc, char* argv[])
> {
> char* input_file_name = "program.c"; char* output_file_name = "program.asm";
> if (argc==3) { input_file_name = argv[1]; output_file_name = argv[2]; }
> chunk d = LoadChunk(input_file_name);
> out_asm_file = fopen(output_file_name, "wb");
>
> chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');
> int n = ChunksLength(lines);
> for(int i=0; i<n; i++) {
> if(ChunkIsEmpty(lines.first[i])) continue;
> chunks atoms = SplitChunkOnAtoms(current_line);
> int atoms_len = ChunksLength(atoms);
> if(atoms_len<1) continue; //skip emty lines
> if( atoms_len>=2 ) if( CCS(a0, "/") ) if( CCS(a1, "/") ) continue; //skip commentary lines
> if(atoms_len>=4) // compile aaa+=222
> if( CCL (a0) ) if( CCS (a1, "+") ) if( CCS (a2, "=") ) if( CCI (a3) ) {
> FlushOutAsmChunkPE("\n mov eax (", a0, ")");
> FlushOutAsmChunkPE("\n add eax ", a3, " ");
> FlushOutAsmChunkPE("\n mov (", a0, ") eax "); }
>
> if(atoms_len>=6) //compile tab[a] = b
> { if( CCL( a0 ) ) if( CCS( a1, "[" ) ) if( CCL( a2 ) ) if( CCS( a3, "]" ) ) if( CCS( a4, "=" ) ) if( CCL( a5 ) )
> {
> FlushOutAsmChunkPE("\n mov ebx (", a5, ") ");
> FlushOutAsmChunkPE("\n mov eax ", a0, " ");
> FlushOutAsmChunkPE("\n add eax (", a2, ") ");
> FlushOutAsmChunkPE("\n mov (eax) ebx ", Chunk(" "), " ");
> continue;
> }
> }
> if(atoms_len >= 5) // compile stdcall "modulename" foo()
> {
> if( CCS(a0, "stdcall") || CCS(a0, "cdecl")) if( CCS(a1, "\"" ) ) if( CCL(a2) ) if( CCS(a3, "." ) ) if( CCL(a4) ) if( CCS(a5, "\"" ) ) if( CCL(a6) ) {
> FlushOutAsm("\n ");
> int args_len = GenerateOPushesForArgumentsOfFunction( current_line);
> FlushOutAsm("\n call (\"%.*s.%.*s\"->%.*s) ", ChunkLength(a2) , a2.beg, ChunkLength(a4) , a4.beg, ChunkLength(a6) , a6.beg );
> if( CCS(a0, "cdecl") )
> for(int i=args_len-1; i>=0; i--) { FlushOutAsm("\n pop eax "); }
> }
> }
>
> /////
> rest here
> /////
> }
> fclose(out_asm_file);
> printf("\n COMPILATION DONE ");
> return 0;
> }
>
> done, compiler written

sorry i missed few lines like


chunk a0 = atoms.first[0];
chunk a1 = atoms.first[1];
chunk a2 = atoms.first[2];
chunk a3 = atoms.first[3];
chunk a4 = atoms.first[4];
chunk a5 = atoms.first[5];
chunk a6 = atoms.first[6];
chunk a7 = atoms.first[7];
chunk a8 = atoms.first[8];
chunk a9 = atoms.first[9];

the trick is i use my sickle.c library it loads text file (chunk is my invention i already written a lot struct chunk {char* beg; char* end;}

chunk d = LoadChunk(input_file_name);
chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');

chunks is an array of chunks (chich is based on reallock seed so it may be internaly resized by this function above, the function breaks initial text into chunk into lines and also breaks after ";" so it is broken on logical lines

this below makes loop on each such logical line

int n = ChunksLength(lines);
for(int i=0; i<n; i++)
{
chunks atoms = SplitChunkOnAtoms(current_line);

this in turn break each line on atoms for example " void foo (int a, float b);"
would return such atoms
"void"
"foo"
"("
"int"
"a"
","
"float"
"b"
")"
";"

regardles of amount of whitespaces beetween - it not touches oryginal data only fu produses atams array which is filled with pointers to begins and ends of such atoms

i got few functions like CCL CCS CCI which stands for compare /cehck if chunk is alphanumeric label, symbol or number/integer so if i will write
if(CCS(atoms.first[0], "int"))
if(CCL(atoms.first[1])
if(CCS(atoms.first[2], "=")
if(CCI(atoms.first[3])
{

}
i know i catched every line like

int aa = -2888;
int something = 0x7777aa;

so i may generate assembly by FlushOutAsm("......") routines;

and thats all compiler done

(its all thnx to my concepts of chunk/chunks spliter and atomizer i wrote on this group already

Re: furia (fir's proto-c compiler)

<a4b5b815-cff5-4703-9d16-0b766ef66fa4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21363&group=comp.lang.c#21363

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:27e5:b0:44f:6273:c2f3 with SMTP id jt5-20020a05621427e500b0044f6273c2f3mr591197qvb.127.1650565185927;
Thu, 21 Apr 2022 11:19:45 -0700 (PDT)
X-Received: by 2002:a37:2704:0:b0:69e:908d:7c44 with SMTP id
n4-20020a372704000000b0069e908d7c44mr471424qkn.450.1650565185778; Thu, 21 Apr
2022 11:19:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 11:19:45 -0700 (PDT)
In-Reply-To: <0e0778c3-4830-4bc7-868a-8ec2c4d5194dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.98; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.98
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
<ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com> <92d1ebf1-9cf0-4873-bf0a-a8b029ad5787n@googlegroups.com>
<0e0778c3-4830-4bc7-868a-8ec2c4d5194dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a4b5b815-cff5-4703-9d16-0b766ef66fa4n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 18:19:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 152
 by: fir - Thu, 21 Apr 2022 18:19 UTC

czwartek, 21 kwietnia 2022 o 20:10:16 UTC+2 fir napisał(a):
> czwartek, 21 kwietnia 2022 o 19:49:03 UTC+2 fir napisał(a):
> > czwartek, 21 kwietnia 2022 o 19:17:05 UTC+2 fir napisał(a):
> > >
> > > i post it in case of somebody would like to discuss related things as its kinda interesting in fact for example i discovered that the compiler is in fact like 20 maybe 30 lines of code - you only need to add next lines to compile next functionalities
> > >
> > wanna see that lines? it is
> >
> > FILE *out_asm_file = NULL ;
> >
> > int main(int argc, char* argv[])
> > {
> > char* input_file_name = "program.c"; char* output_file_name = "program.asm";
> > if (argc==3) { input_file_name = argv[1]; output_file_name = argv[2]; }
> > chunk d = LoadChunk(input_file_name);
> > out_asm_file = fopen(output_file_name, "wb");
> >
> > chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');
> > int n = ChunksLength(lines);
> > for(int i=0; i<n; i++) {
> > if(ChunkIsEmpty(lines.first[i])) continue;
> > chunks atoms = SplitChunkOnAtoms(current_line);
> > int atoms_len = ChunksLength(atoms);
> > if(atoms_len<1) continue; //skip emty lines
> > if( atoms_len>=2 ) if( CCS(a0, "/") ) if( CCS(a1, "/") ) continue; //skip commentary lines
> > if(atoms_len>=4) // compile aaa+=222
> > if( CCL (a0) ) if( CCS (a1, "+") ) if( CCS (a2, "=") ) if( CCI (a3) ) {
> > FlushOutAsmChunkPE("\n mov eax (", a0, ")");
> > FlushOutAsmChunkPE("\n add eax ", a3, " ");
> > FlushOutAsmChunkPE("\n mov (", a0, ") eax "); }
> >
> > if(atoms_len>=6) //compile tab[a] = b
> > { if( CCL( a0 ) ) if( CCS( a1, "[" ) ) if( CCL( a2 ) ) if( CCS( a3, "]" ) ) if( CCS( a4, "=" ) ) if( CCL( a5 ) )
> > {
> > FlushOutAsmChunkPE("\n mov ebx (", a5, ") ");
> > FlushOutAsmChunkPE("\n mov eax ", a0, " ");
> > FlushOutAsmChunkPE("\n add eax (", a2, ") ");
> > FlushOutAsmChunkPE("\n mov (eax) ebx ", Chunk(" "), " ");
> > continue;
> > }
> > }
> > if(atoms_len >= 5) // compile stdcall "modulename" foo()
> > {
> > if( CCS(a0, "stdcall") || CCS(a0, "cdecl")) if( CCS(a1, "\"" ) ) if( CCL(a2) ) if( CCS(a3, "." ) ) if( CCL(a4) ) if( CCS(a5, "\"" ) ) if( CCL(a6) ) {
> > FlushOutAsm("\n ");
> > int args_len = GenerateOPushesForArgumentsOfFunction( current_line);
> > FlushOutAsm("\n call (\"%.*s.%.*s\"->%.*s) ", ChunkLength(a2) , a2.beg, ChunkLength(a4) , a4.beg, ChunkLength(a6) , a6.beg );
> > if( CCS(a0, "cdecl") )
> > for(int i=args_len-1; i>=0; i--) { FlushOutAsm("\n pop eax "); }
> > }
> > }
> >
> > /////
> > rest here
> > /////
> > }
> > fclose(out_asm_file);
> > printf("\n COMPILATION DONE ");
> > return 0;
> > }
> >
> > done, compiler written
> sorry i missed few lines like
>
>
> chunk a0 = atoms.first[0];
> chunk a1 = atoms.first[1];
> chunk a2 = atoms.first[2];
> chunk a3 = atoms.first[3];
> chunk a4 = atoms.first[4];
> chunk a5 = atoms.first[5];
> chunk a6 = atoms.first[6];
> chunk a7 = atoms.first[7];
> chunk a8 = atoms.first[8];
> chunk a9 = atoms.first[9];
>
> the trick is i use my sickle.c library it loads text file (chunk is my invention i already written a lot struct chunk {char* beg; char* end;}
>
> chunk d = LoadChunk(input_file_name);
> chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');
> chunks is an array of chunks (chich is based on reallock seed so it may be internaly resized by this function above, the function breaks initial text into chunk into lines and also breaks after ";" so it is broken on logical lines
>
> this below makes loop on each such logical line
> int n = ChunksLength(lines);
> for(int i=0; i<n; i++)
> {
> chunks atoms = SplitChunkOnAtoms(current_line);
>
> this in turn break each line on atoms for example " void foo (int a, float b);"
> would return such atoms
> "void"
> "foo"
> "("
> "int"
> "a"
> ","
> "float"
> "b"
> ")"
> ";"
>
> regardles of amount of whitespaces beetween - it not touches oryginal data only fu produses atams array which is filled with pointers to begins and ends of such atoms
>
> i got few functions like CCL CCS CCI which stands for compare /cehck if chunk is alphanumeric label, symbol or number/integer so if i will write
> if(CCS(atoms.first[0], "int"))
> if(CCL(atoms.first[1])
> if(CCS(atoms.first[2], "=")
> if(CCI(atoms.first[3])
> {
>
> }
> i know i catched every line like
>
> int aa = -2888;
> int something = 0x7777aa;
>
> so i may generate assembly by FlushOutAsm("......") routines;
>
> and thats all compiler done
>
> (its all thnx to my concepts of chunk/chunks spliter and atomizer i wrote on this group already

must say i find it cool/fine as i think i got some talent in simplyfing things like that
thsi code of the compiler i tinker in ad pasted has some simple errors (i mean things i would
slightly rewrite to make it cleaner) but this is becouse i clarify some things when working on this
(like how exactly sickle.c library should contain) so it is working state....but this scheme of compilation i find quite cool bot liek dam recursive codes or bison yaxx whopse i dont know but seem rather horrible approach (yawn)

Re: furia (fir's proto-c compiler)

<9c298099-fe0f-43b3-8a80-bfbe62946937n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21364&group=comp.lang.c#21364

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:765:b0:446:5ba9:acc3 with SMTP id f5-20020a056214076500b004465ba9acc3mr880621qvz.113.1650565922340;
Thu, 21 Apr 2022 11:32:02 -0700 (PDT)
X-Received: by 2002:ac8:5851:0:b0:2e1:eba3:3beb with SMTP id
h17-20020ac85851000000b002e1eba33bebmr629668qth.20.1650565922213; Thu, 21 Apr
2022 11:32:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 11:32:02 -0700 (PDT)
In-Reply-To: <0e0778c3-4830-4bc7-868a-8ec2c4d5194dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.98; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.98
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
<ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com> <92d1ebf1-9cf0-4873-bf0a-a8b029ad5787n@googlegroups.com>
<0e0778c3-4830-4bc7-868a-8ec2c4d5194dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9c298099-fe0f-43b3-8a80-bfbe62946937n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 18:32:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 75
 by: fir - Thu, 21 Apr 2022 18:32 UTC

czwartek, 21 kwietnia 2022 o 20:10:16 UTC+2 fir napisał(a):
>
> the trick is i use my sickle.c library it loads text file (chunk is my invention i already written a lot struct chunk {char* beg; char* end;}
>
> chunk d = LoadChunk(input_file_name);
> chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');
> chunks is an array of chunks (chich is based on reallock seed so it may be internaly resized by this function above, the function breaks initial text into chunk into lines and also breaks after ";" so it is broken on logical lines
>
> this below makes loop on each such logical line
> int n = ChunksLength(lines);
> for(int i=0; i<n; i++)
> {
> chunks atoms = SplitChunkOnAtoms(current_line);
>
> this in turn break each line on atoms for example " void foo (int a, float b);"
> would return such atoms
> "void"
> "foo"
> "("
> "int"
> "a"
> ","
> "float"
> "b"
> ")"
> ";"
>
> regardles of amount of whitespaces beetween - it not touches oryginal data only fu produses atams array which is filled with pointers to begins and ends of such atoms
>
> i got few functions like CCL CCS CCI which stands for compare /cehck if chunk is alphanumeric label, symbol or number/integer so if i will write
> if(CCS(atoms.first[0], "int"))
> if(CCL(atoms.first[1])
> if(CCS(atoms.first[2], "=")
> if(CCI(atoms.first[3])
> {
>
> }
> i know i catched every line like
>
> int aa = -2888;
> int something = 0x7777aa;
>
> so i may generate assembly by FlushOutAsm("......") routines;
>
> and thats all compiler done
>
> (its all thnx to my concepts of chunk/chunks spliter and atomizer i wrote on this group already

ye i probbaly sjpould write cleaner example from this above, so the compiler its like

chunk d = LoadChunk(input_file_name);
chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');
int n = ChunksLength(lines);
for(int i=0; i<n; i++)
{
chunks atoms = SplitChunkOnAtoms(current_line);
//translate all type int xxx = 1111
if(CCS(atoms.first[0], "int")) if(CCL(atoms.first[1]) if(CCS(atoms.first[2], "=") if(CCI(atoms.first[3]) {
FlushOutAsmStr("\n .data "); FlushOutAsmChunk(atoms.first[1); FlushOutAsmStr(" "); FlushOutAsmChunk(atoms.first[3); FlushOutAsmStr("i "); }
}

this above is a compiler and its kinda general one, some just needed to put more translation blocks, error checking etc

Re: furia (fir's proto-c compiler)

<180794b5-89a1-4644-8306-7033998fb4d8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21365&group=comp.lang.c#21365

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5754:0:b0:2e1:eee8:be0b with SMTP id 20-20020ac85754000000b002e1eee8be0bmr612668qtx.349.1650566476293;
Thu, 21 Apr 2022 11:41:16 -0700 (PDT)
X-Received: by 2002:a0c:fa43:0:b0:444:5137:44b0 with SMTP id
k3-20020a0cfa43000000b00444513744b0mr933394qvo.29.1650566476133; Thu, 21 Apr
2022 11:41:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 11:41:15 -0700 (PDT)
In-Reply-To: <9c298099-fe0f-43b3-8a80-bfbe62946937n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.98; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.98
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
<ae93bad9-89e9-4483-a350-17b5d0f67912n@googlegroups.com> <92d1ebf1-9cf0-4873-bf0a-a8b029ad5787n@googlegroups.com>
<0e0778c3-4830-4bc7-868a-8ec2c4d5194dn@googlegroups.com> <9c298099-fe0f-43b3-8a80-bfbe62946937n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <180794b5-89a1-4644-8306-7033998fb4d8n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 18:41:16 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 34
 by: fir - Thu, 21 Apr 2022 18:41 UTC

czwartek, 21 kwietnia 2022 o 20:32:10 UTC+2 fir napisał(a):
> >
> > (its all thnx to my concepts of chunk/chunks spliter and atomizer i wrote on this group already
> ye i probbaly sjpould write cleaner example from this above, so the compiler its like
> chunk d = LoadChunk(input_file_name);
> chunks lines = SplitAfterCharacterOrCharacter(d, 0x0a, ';');
> int n = ChunksLength(lines);
> for(int i=0; i<n; i++)
> {
> chunks atoms = SplitChunkOnAtoms(current_line);
> //translate all type int xxx = 1111
> if(CCS(atoms.first[0], "int")) if(CCL(atoms.first[1]) if(CCS(atoms.first[2], "=") if(CCI(atoms.first[3]) {
> FlushOutAsmStr("\n .data "); FlushOutAsmChunk(atoms.first[1); FlushOutAsmStr(" "); FlushOutAsmChunk(atoms.first[3); FlushOutAsmStr("i "); }
> }

current_line should be lines.first[i]
or
chunk current_line = lines.first[i];
should be added

i got slight conceptual problem if i should use the word first,
as chunk is chunk {char* beg; char* end; }
i decided to use other names than beg end in chunks structure , becouse if i would use the same it is confusing not only for chunk newbs , so i used first and last
chunks {chunk* first; chunk* last; }
but the first not fully fits, as for example in atoms.first[4] this titles the chunk number 4 in array so
the word first not fully fits imo, maybe it should be atoms.chunk[4] there for example 2nd letter of 5th chunk yu acces by atoms[4].chunk.beg[1] the last probably can stay

Re: furia (fir's proto-c compiler)

<5e503328-3494-424c-a844-34401ada1d69n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21372&group=comp.lang.c#21372

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:18a3:b0:2f1:f958:38cc with SMTP id v35-20020a05622a18a300b002f1f95838ccmr1299705qtc.171.1650582589323;
Thu, 21 Apr 2022 16:09:49 -0700 (PDT)
X-Received: by 2002:a05:622a:1356:b0:2f1:f997:7857 with SMTP id
w22-20020a05622a135600b002f1f9977857mr1376671qtk.50.1650582589111; Thu, 21
Apr 2022 16:09:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 16:09:48 -0700 (PDT)
In-Reply-To: <a8d7eadf-a060-4e93-ad3f-1627f09745a7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.216; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.216
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<20e75c0f-4b70-47e9-8709-a25816f323dbn@googlegroups.com> <3c9bc703-37da-4513-aec2-d764e1a5290an@googlegroups.com>
<20220420105323.851@kylheku.com> <49d66cbd-65f8-45fd-a6df-1eeaeed254c2n@googlegroups.com>
<a8d7eadf-a060-4e93-ad3f-1627f09745a7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5e503328-3494-424c-a844-34401ada1d69n@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 21 Apr 2022 23:09:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 18
 by: fir - Thu, 21 Apr 2022 23:09 UTC

środa, 20 kwietnia 2022 o 20:29:14 UTC+2 fir napisał(a):
>.and i need yet to compile that damn nested expressions and some side things i yet not even thinkd

in fact it seem i forgot what i already got

(its becouse i coded this 2 or 3 tears ago.. it seem in fact that as to this expresion i write some a bit weird code which takes soem wxpresion which have parentheses and work on it like it would be the data, scans and takes things like "a*b" and replaces it by t1 puting aside t1=a*b and do that in loop top this extend it puts out all operators... it seem weird to me as its slow etc but i forgot it in fact at least work, code it produces is also far from good but for now for me its standable, so in fact i could say i got those expressions mostly done... more good i seen to forget that extending it to the extemnt it would contain some things like array indexing or function calls seem in fact strightforward, so in fact im not sure what i was worying about (maybe becouse this is not optymal but i realized i dont care for optimal at this stage)
still it is yet few days of work esp i would need add floats

Re: furia (fir's proto-c compiler)

<536a454e-defd-455d-8658-473b4bfbbe9en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21373&group=comp.lang.c#21373

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:593:b0:2e1:eabd:5e25 with SMTP id c19-20020a05622a059300b002e1eabd5e25mr1693674qtb.191.1650593554709;
Thu, 21 Apr 2022 19:12:34 -0700 (PDT)
X-Received: by 2002:ad4:5c45:0:b0:446:5af6:7706 with SMTP id
a5-20020ad45c45000000b004465af67706mr2068435qva.112.1650593554509; Thu, 21
Apr 2022 19:12:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 21 Apr 2022 19:12:34 -0700 (PDT)
In-Reply-To: <cc30eb49-19d7-47e7-aafe-1828812b3b1bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.81; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.81
References: <e4215069-758d-4a70-8ba5-7383bba01aa0n@googlegroups.com>
<42c02917-5ac6-417f-a3a3-d10627f44db8n@googlegroups.com> <a9d0ce49-5407-4b02-8c98-808f25e2db4dn@googlegroups.com>
<cc30eb49-19d7-47e7-aafe-1828812b3b1bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <536a454e-defd-455d-8658-473b4bfbbe9en@googlegroups.com>
Subject: Re: furia (fir's proto-c compiler)
From: profesor...@gmail.com (fir)
Injection-Date: Fri, 22 Apr 2022 02:12:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 80
 by: fir - Fri, 22 Apr 2022 02:12 UTC

czwartek, 21 kwietnia 2022 o 19:25:03 UTC+2 bart c napisał(a):
> This worked. Already it did say the file would be deleted after downloading (you may need to re-upload?).
>
the first site seemd to be designed to share something only for one download... this filebin hosts
for 6 days

i found 2 years ago i also made i may call functions in what i call naked form (what i was writing bac then i found viable alternative

foo(a,b,c);
foo a b c ; //naked form

https://filebin.net/33fxpjsgk846ymb2

also gave alternative for initialisation

int a = 10;
int a{10}

so now it can compile

import "green_fire.dll" cdecl DrawSomeText2
import "green_fire.dll" cdecl ToggleFullscreen
import "green_fire.dll" cdecl ClearFrameData
import "green_fire.dll" cdecl DrawCircle
import "green_fire.dll" cdecl RegisterRunFrame
import "green_fire.dll" cdecl RegisterMouseMove
import "green_fire.dll" cdecl RegisterKeyDown
import "green_fire.dll" cdecl RegisterOnResize
import "green_fire.dll" cdecl SetSleepValue
import "green_fire.dll" cdecl SetScaleOnResize
import "green_fire.dll" cdecl SetupWindow3

void ProcessMouseMove(int mouse_x, int mouse_y)
return

void ProcessKeyDown(int last_key_pressed)
int PAGE_UP{33}
if last_key_pressed = PAGE_UP
ToggleFullscreen(); .
return

void RollBackgroundColor()
int background_color {0x00000001}
background_color += 1;
ClearFrameData background_color
return

void RunFrame()
RollBackgroundColor()
int r{10}
for r from 10 to 250 step 3
DrawCircle mouse_x mouse_y r 0xff00
.
DrawSomeText2 0xffffff 10 30 "this app is compiled by furia \x00"
DrawSomeText2 0xffffff 30 130 "mouse %d %d\x00" mouse_x mouse_y
int b {2} ; int c {10}
b = 2;c = 10; b = c/(b-1)+c*(c-2);
DrawSomeText2 0xffffff 20 140 " %d \x00" b
b = 2; c = 10; lisplike b = c+b*7/4+3-12 ;
DrawSomeText2 0xffffff 20 150 " %d \x00" b
return

void OnResize()
return

void main()
RegisterRunFrame &RunFrame
RegisterMouseMove &ProcessMouseMove
RegisterKeyDown &ProcessKeyDown
RegisterOnResize &OnResize
SetSleepValue 30
SetScaleOnResize 1
SetupWindow3 " compiled by fir's furia proto c compiler \x00" 10 10 600 400 300 200
return

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor