flat assembler
Message board for the users of flat assembler.

flat assembler > Heap > Dynamic Programming Language - Parser Friendly

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
ok, i think this is damn it important, it is great idea that could rock this world,

how about a programming language that is so dynamic that gonna suit everybody style?

in another words, it means, let users, programmers themselves define how a language suppose to work, what we need to do is just setting up the base, and after that, let users invent their own rules.

eg,
suppose i want to build a native win32 GUI application,

the code could be like below,
Code:
win32
w1 = window();
w1.control = txt1()
w1.controls = btn1(),btn2(),list1(),combo1()
txt1(x,y,width,height)=20,20,100,400
    


assume users want a language style like above, so what he gonna do is write a parser to interface with the base logic.

what i recommend is a macro base solution (after i saw uart777 submitted examples)

so, basically, everything gonna be rendered back to assembly language syntax,
but user could invent any style they like.

and that would be really awesome! Cool

the main point is, a base system that "user/environment friendly" for parser to get integrated!
Post 25 Jan 2013, 08:17
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16778
Location: In your JS exploiting you and your system
I think assembly is already dynamic and people can mostly just do whatever they want (and they do just that). I believe this is also why assembly is always a solitary pursuit. We never see any teams be able to get things moving here because everyone wants to do things their own way.

One person does something one way and another sees that as ugly and does it a different way. And there are as many ways things get done as there are people programming it.

Inventing a language that just lets people do whatever they want simply brings us back to where we are now with assembly. No wide acceptance at most levels unless it is necessary for the task, and no standards to follow means a mess for new comers to wade through.

I do wish assembly would get some corporation behind it and start mandating standards, that would most likely improve its standing. But I doubt anyone will ever accept mandates from "big corp" and most will still just do their own thing ... in solitude. It seems anarchy rules here.
Post 25 Jan 2013, 08:35
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
that is certainly a good point from you revolution,

i try to view things like this,
the idea of mass conformity is due to marketing,
if let say a .nut ads are shown on every major broadcast 24x7, that would certainly push people into accepting that tools/ideas as standard.

imo, i believe, we don't have to enforce users into any particular rules (ya, anarchy rules), let them voyage into rabbit,s hole, may they find what they wish.

of course, such approach might end up with nothing, haha Laughing
nobody need to conform to a particular style, everybody can rock this world if they want Cool
just try harder if the target is universe!
Post 25 Jan 2013, 08:55
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
sleepsleep, you need to read about the Lenin's definition of "freedom" as "realized necessity". Think about it. Smile
Post 25 Jan 2013, 09:31
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 820
Location: Jakarta, Indonesia
sleepsleep wrote:

in another words, it means, let users, programmers themselves define how a language suppose to work, what we need to do is just setting up the base, and after that, let users invent their own rules.


Somehow this reminds me of... Lisp.
It's said that Lisp is "the programmable programming language" Idea
Post 25 Jan 2013, 17:08
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
[quote="TmX"][quote="sleepsleep"]Somehow this reminds me of... Lisp.
It's said that Lisp is "the programmable programming language" Idea/quote]
Hah, you beat me to posting that Smile

Anyway, I agree with revolution, and don't really think it would be a very good (nor successful) idea - the benefit of having a programming language is being able to share code (and ideas) with other people in one... well... language. If you're going to make a "super polymorphic language capable of everything", you might as well, build purpose-specific languages (for your own use...) on top of an existing toolchain like LLVM.

There's already languages that can be bent pretty far syntax-wise - even in C++ it's possible to build your own mini-languages, and you can do nice things in C#, Scala and Ruby as well. Thing is, even in the confines of those languages, you still have enough flexibility to come up with DSLs that are very hard for other people to read, even if they're experts in the language you've written the DSL in...

_________________
Image - carpe noctem
Post 25 Jan 2013, 17:43
View user's profile Send private message Visit poster's website Reply with quote
pabloreda



Joined: 24 Jan 2007
Posts: 90
Location: Argentina
the sleepsleep quote is IMHO the definition of FORTH, or too.. a LISP without ()
Post 25 Jan 2013, 21:58
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 820
Location: Jakarta, Indonesia
BTW this stuff probably will grab sleepsleep's attention

Quote:

Plof is an extremely flexible programming language, and an experiment in pushing this flexibility to its logical extreme. Plof's grammar is defined at runtime (predominantly by code written in Plof) and can be extended very simply by Plof code.

http://plof.codu.org/wiki/


Wink
Post 26 Jan 2013, 07:08
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
thanks tmx,

i was thinking that fasm macro is more than capable to be integrated as base language that got built in parser for easier custom style invention,

and uart777 seems like the person i am willing to pay for customization =P

this is damn fun, we got lots of genius in this board to rock this world into very positive environment!
Post 26 Jan 2013, 13:28
View user's profile Send private message Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
sleepsleep wrote:
in another words, it means, let users, programmers themselves define how a language suppose to work, what we need to do is just setting up the base, and after that, let users invent their own rules.



This language already exists! It's called Tcl!

Check out these links:
http://wiki.tcl.tk/495

http://wiki.tcl.tk/1613

http://wiki.tcl.tk/1128

Tcl is a highly dynamic language where code is data. You can rewrite language structures in Tcl itself. Also everything is a string so it's very flexible.

Tcl is like LISP (a programable programming language), but the syntax reminds of Shell Script and C.
Post 27 Jan 2013, 00:01
View user's profile Send private message Reply with quote
Spool



Joined: 08 Jan 2013
Posts: 154
[]


Last edited by Spool on 17 Mar 2013, 04:32; edited 1 time in total
Post 27 Jan 2013, 03:34
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
i actually feel that the syntax for C# is nice,
if we got a C# -> Fasm source -> machine code

that would really rocks! imo.

Tcl, i will take a look at it, Ozzy, thanks!

ok, i think my strategy is like this,
i need help guys Smile

a parser to read my $$ source file, convert it into fasm source file, assembly it with fasm

i brief out the syntax, hopefully the parser would just magically appear Laughing


1. do programmer need to define variable?
my answer is, no need,
since registers are DWORD size, we declare very variable is DWORD,
in 64bit, every variable is QWORD,

value assigning to variable, standard way
A = 5

the idea of ";" makes possible to write lots of things in 1 line
A = 5; B = 10; C = 20;

another way to do it is;
A,B,C = 5,10,20 (i vote for this one)
so we can do for STRING as well,
A,B,C = 5, "this is hello world", 20+40

to get translated into something like below,
mov eax,objectmemoryaddress
mov [eax],DWORD
inc eax
mov [eax],addr0001
inc eax
mov [eax],STRING
inc eax
mov [eax],addr002
mov [addr0001],var0001
mov [addr0002],var0002
mov [addr0003],var0003
mov [var0001],5
mov [var0002],10
mov [var0003],20

we use 3 layers, OBJECT=>ADDRESS=>VALUE

each variable/object would call procedure by using itself as input like the below syntax,
A = B.Length
stdcall Length,[var0002]

so, how about procedure that require more argument,
B.Split("@")
this would actually = call procedure Split,[var0002],"@"
of course, the code will check the type of object at objectmemoryaddress first before doing the split.

if then else.
Code:
B.Split("@").Result[0]
= 1 ?
  A,C = 40, 50
= 2 ?
  A,C = 400, 500
= ?
  A,C = 0,0
    

here, we are concern with procedure that would return 1 result, and many results,

eg, Split("@") would probably return
[0] = split found @ or not, 0 = no, 1 = yes, 2 to x = count of @ found
[1] = address of first string from start to end before first @
[1][0] = length of [1]
[2] = address of first string from start to end before second @
[2][0] = length of [2]


for loop (i,j,k,l,m,n = counter variable)
Code:
i = 1 // i would increase by 1
i = 5 // i would increase by 5
i = -10 // i would decrease by 10
0 > 100
  A = A + i

  // if A = 50 then exit loop <
  A = 50 ? <
<
    


maybe i gonna go insane after i use this language, Laughing
Post 29 Jan 2013, 16:43
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
one idea just pop in,
why we must mix data with code?

even mov eax,8 should be considered evil, =)
Post 31 Jan 2013, 15:35
View user's profile Send private message Reply with quote
ASM-Man



Joined: 11 Jan 2013
Posts: 65
Are you thinking in the concept of parse a grammar and by using the compiler(or interpreter) generated by this grammar compiler/interpreter and then the final grammar defined by the user? you should already know that it's possible,but I bit hard.
But as do you expect the grammar be given? by a EBFN or EBNF-like language or yet,something more "dynamic" that EBFN syntax?

I think that a great virtual machine with a very very smart and configurable preprocessor may be the "solution". Also,do you wanna a linguage with "clear" syntax? will be hard to keep it,if you want to implement it. I think that the path is a lisp-like interpreted language.
Post 31 Jan 2013, 16:41
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
hi ASM-Man,
i think i think too much, but kinda make me feel the joy to think about this whole stuff. =)

it seems that we mix the INPUT -> PROCESS -> OUTPUT in asm or c source code.

i believe, the idea of programming is in the PROCESS part, which mean, the INPUT and OUTPUT should be totally separate from programming.

INPUT should be INPUT, waiting to be process, what that is NO LONGER NEED TO PROCESS is not INPUT, it is OUTPUT.

so what if OUTPUT become INPUT for another PROCESS, it seems we got problem with what is INPUT and what is OUTPUT.

so, logic says, it is PROCESS that determine what is INPUT and what is OUTPUT.

and what if variable could be tracked automatically by line number where it is uses? (maybe need IDE support here)

Code:
input source file
#100 string username = "sleepsleep";
#101 string location = "malaysia";
#102 int age = 100;

process/event source file
load 100-102
#202 strlen(username)
#203 replace(location, "m", "M");
#204 age = age / 5;
#205 <blank> for start of another procedure/process

output source file
load 202-204
My Name is #202
I am located at #203
    


the idea of using load from line to line is to let user practice grouping connected variables in same section.
thus easy to debug & understand, and prevent modification to another variable section.

of course, what presented is just really simple way to explain what is in my mind.
Post 31 Jan 2013, 17:45
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
i been thinking lately,
the new programming language is suppose able to "link" dynamically (basic included feature)

and another basic must feature is, link with database. eg. mysql or sqlite or any other db.

so you could use table as a separation of different parts of your software / web application.

you could create variable that automatically link change to db,

and all variable got a native onchange event,

you could hook the event and write what should do if var value is changed.

and we could have one db var monitor that 24x7 shows all variables values live. (live debug)

representation of var in different platform should be handled by architecture

and people could use different languages with this link feature.

eg.
let say in javascript

var userid;
usertbl.link = some magic perform;
usertbl.add("sleepsleep", "hispassword", "full name");
// SQL auto exec INSERT INTO usertbl (id,pwd,fname) VALUES ('sleepsleep', 'hispassword', 'full name');

then another feature is variable log
eg,
var counter1;
couter1.link = some magic perform;

counter1 = 5
counter1 = 10
// doing some process
counter1 = 0;

so in the SQL database,
SELECT log FROM var WHERE logid='counter1';
would dump
datetime 5
datetime 10
datetime 0

this should work in ASM too

stdcall regVariable,"counter1"
// log mov will become .mov for example
.mov [counter1],5
.mov [counter1],10
.mov [counter1],0


basically, what i am trying to say is, the future programming will be linked to database, all variables, all function, all classes and etc.

then we will have a torrent type database with opensource source code.

all code will have 3 crucial information, INPUT, PROCESS and OUTPUT and probably license.

and every coder can use whatever code that they like, by sending the INPUT, let the CLOUD process or your own PC to process, and take the OUTPUT display or another cycle as INPUT.

so in the near future, programming will change into "management"
the best code is on the cloud,

the programmer is the manager who use his tablet to tap click, drag, and set how his variables work.
Post 11 Mar 2013, 20:25
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1394
Location: Toronto, Canada
This type of programming was already invented and it is called Form Design.
Basically you have a form or a set of forms, where each field may be connected to a DB table/column.
The controls on a form are filled with SQL queries.
If you perform an event (click on button, list, etc.) -- also some SQL
can be executed, like INSERT/UPDATE/SELECT, etc.

So, you have invented .NET! Again!!
Post 11 Mar 2013, 21:30
View user's profile Send private message Send e-mail Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
ah, form design,
well, like access, yes,

but, i wish to clarify the differences,

in access, with the db to input control integration, you still create function, variables and so on independently,

my suggestion is, total integration,
so, a variable could only be used if it is declare in database, so as functions.

and means, no more source code in text file,
all code must be located inside database.

which mean, you could use your ipad or mobile phone, probably using phpMyAdmin, you could edit your code at fly, save, and your web application is updated automatically.

even building a native win32/64 application, we will use linked db web application feature to manage all the variables, functions, procedures.

maybe idk what i am saying now, lack of coffee.
Post 12 Mar 2013, 05:46
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1394
Location: Toronto, Canada
Interesting, but how fast the code will be?
Because all code is inside a database, so some overhead will be introduced.
What about multiple users wanting to execute the same function from database? Even slower.
We need Enterprise computers to run that.
Post 12 Mar 2013, 12:38
View user's profile Send private message Send e-mail Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8403
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
ok, the database could be in mounted memory disks,
or, the database will be how the application get develop, after finalization, they could assemble it into no integration with database.

because application are getting complex everyday, and language introduce more and more layers,

the last method is switch back to assembly language, direct,
but we need management tools

maybe we should create variable in such a way,

stdcall newVar,"varname",0
stdcall setVar,"varname",new value
stdcall delVar,"varname"

or eventually, any way that programmer like, (thats why the initial idea future language must be parser friendly)

v. // create variable
v.new value // set value
v // delete variable

or short-cut to v.new value (auto check if variable created, create if none)

and the newVar / setVar, delVar if link with database, will enable us live monitoring

then procedure will use standard naming, which is, param1, param2 and .... to paramXYZ, or arg1, arg2 to argXYZ

procedure countTotal, param1, param2
$countTotal.param1.param2 (stdcall)
@counTotal.param1.param2 (you beat me what call)

v.@counTotal.param1.param2
> v = 0 // if
// do something 0
>> v > 100
// else if v > 100
>>>
// else
<
(param shortcut to p)
$counTotal.param1.param2
> (p1 = p2 - 50) > 100
l1.p1
<
$

idk what i am typing, more coffee,, =)
Post 12 Mar 2013, 18:31
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.