r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[World] For discussion of World language

Geomol
9-Dec-2011
[537]
Today World types in routines are considered, when typecheck is on, 
and conversion is then carried out between the World type and the 
C type for the arguments, and the C type and the World type for the 
result. Examples with "clock" from libc under OS X:


w> clock: make routine! [libc "clock" sint64]	; The simple version
w> clock
== 79551135

w> clock: make routine! [[typecheck ]libc "clock" sint64 real!]		; 
Result as real!
w> clock
== 79576741.0

w> clock: make routine! [[typecheck ]libc "clock" sint64 complex!]	; 
Result as complex!
w> clock
== 79621776+0i
Oldes
9-Dec-2011
[538]
just brainstorming... don't you want to use something like datatype 
notation for world's types as well?
Geomol
9-Dec-2011
[539x11]
World types as exclamation mark (!) in the end. C types don't. Do 
I misunderstand the question?
as -> has
In the above, sint64 is a C type, real! is a World type.
(Shouldn't I had said: "World types *have*", because it's plural?)
New release at https://github.com/Geomol/World
- Added handle! datatype
- Gave routines an overhaul
- Added AS native to change type of series without copying.
- Fixed crash with function redefinition to reset compile state
- Updated cortex_alpha.pdf, the section about routine!, and added 
handle! and AS.
Regarding AS, the REBOL AS-BINARY and AS-STRING can be achieved with:

as binary! ...
as string! ...

But it's also possible to do:

w> as issue! "abc"
== #abc
w> as paren! [a b c]
== (a b c)
w> as tag! "title"
== <title>

and many other combinations.
Performance wise, it's of course faster to use AS than e.g. TO:

w> dt [loop 1000000 [to binary! "abc"]]
== 0:00:00.420204
w> dt [loop 1000000 [as binary! "abc"]]
== 0:00:00.133765
People trying out the routine! implementation, please speak up, if 
you find anything strange, so I can fix it, while it's fresh in memory.
Handles are made with:

	handle: make handle! none


Some routines might return handles, and those are not necessary to 
made yourself.
Maxim
9-Dec-2011
[550x3]
wow a lot of activity here since I last checked...
one little note about handle! is that it should be immutable and 
cannot be created from within the interpreter beyond defining a null 
pointer, as above.   value holding handles should only be returned 
from a routine.


the idea here is that you should not be able to mangle handles, for 
a variety of reasons.
its tempting to be able to do:  

i: to integer! my-handle
i : i + 1
some-routine i


but its very bad practice (from within a scripting language) IMHO 
since it allows all manner of crashes to occur, not to speak of security 
issues this can open up as well.
Geomol
9-Dec-2011
[553]
Yes. I made it possible to view the content of a handle with MOLD. 
That should be ok.
Maxim
9-Dec-2011
[554]
peeking is ok (often neccessary for debugging), as long as you can't 
change it  :-)
Geomol
9-Dec-2011
[555]
Right.
Maxim
9-Dec-2011
[556]
btw VERY happy you kept the lib-ffi type names within your routine! 
implementation  :-)
Geomol
9-Dec-2011
[557]
Having all the libffi C types should cover all possible libraries. 
(I guess.)

struct! isn't there yet though. I think, structures are needed for 
some routines? Else it's a hard job juggling with binaries.
Kaj
9-Dec-2011
[558]
Structures are needed for almost all routines
Maxim
9-Dec-2011
[559x2]
yep.
my only suggestion for structures...  make it so the semantics are 
exactly the same as C.    
i.e. you take a C header file, and do:

replace/all header-string "{" "["  
replace/all header-string "}" "]"  
replace/all header-string "char *" "pointer"
...


and basically you've got your simplest World version of the spec 
 ;-)
Geomol
9-Dec-2011
[561]
Cool, I'll check that out.
Maxim
9-Dec-2011
[562]
also, I would really like if the return value setup for a routine! 
could include an optional  function block which is run on the return 
value.  

it would prevent the very common instance where you have to write 
stubs for the routines (such as normalizing return values on errors 
or converting values to some better internal mechanism).
Geomol
9-Dec-2011
[563]
Better error! implementation is high on my list. Also needed to implement 
TRY.
Maxim
9-Dec-2011
[564]
btw, regarding the struct interface, making as close to C as possible 
allows you to support any binary api and will allow you support the 
more complex twists.


things like arrays of pointers and pointers to arrays of pointers, 
etc... these things are often overlooked (like they where in R2) 
and create major headaches or downright project blocking in some 
cases.
GiuseppeC
9-Dec-2011
[565x4]
Geomol, I am reconnectin to the Rebol3 world after a long time of 
absence.
It comes as surprise you new REBOL inspired new language. It is inevitable 
that things like TOPAZ and RED are created after the long absence 
of CARL. There is a stong need from the market and the market is 
US programmers which cannot wait any longer.
First of all a question: which will be the difference and improvements 
comparing to REBOL ?
Now will come my considerations about Licensing and development.
Geomol
9-Dec-2011
[569]
Difference: Based on a virtual machine, that source can compile to. 
Many different design decisions, but many of those can be redone 
to be REBOL compatible by defining words. This is what %rebol.w is 
for.


Improvements: Faster in many cases because of the VM. I try to make 
it better in all those areas, where I find REBOL not good enough. 
Datatypes like complex! and more in the future. I also try to cut 
into the bone and only create that at the core, that is really needed. 
I see that as an improvement.
GiuseppeC
9-Dec-2011
[570]
You are the project LEADER and you are the creator of this wonderful 
project. You have a VISION, a destination.

Back in time, when CARL was developing REBOL3 he created a roadmap 
explaining us what would be the structure of the language, its modules 
and how they cooperate.

This inspired suggestions from the community, changes in the roadmap 
but more preciosuly it created expectation, commitment and willingnes 
to cooperate.
Geomol
9-Dec-2011
[571x2]
I feel more like only reveal new stuff, when it's just about to emerge, 
or is already done. I've seen too many promises, that didn't materialize.
I'm very focused to get to version 1. When that's done (or almost 
done), it makes more sense to launch parallel projects. If someone 
offer me a business opportunity, I'm willing to change my focus or 
work on specific projects.
GiuseppeC
9-Dec-2011
[573]
(Please, give me the opportunity to finish myt talk. I am quite slow 
at english writing !)
Geomol
9-Dec-2011
[574]
np :)
GiuseppeC
9-Dec-2011
[575x7]
You are a programmer but you should be an inspirator and entrepreneur. 
Like a programmer you first released the alpha version before selling 
the idea ! :-) You came out from your BatCave after 2 years of silence 
telling us "look here what I have created". This is good as it proves 
you deliver other than promising. 


Somewhere, in the road to version 1.0 you will need help. It belongs 
to you teling us when you will have clear in your mind the whole 
project. Then, please SHARE THE VISION and ask for cooperation and 
involvement of other programmers.


You are not alone. There is lot of skilled people here. They will 
be happy to give their input to you.

This will avoid being World as a one man project and will put the 
basis for collaboration.
When you will be ready for this I ask you to make few thing:

1) Create a white paper with your vision to let us know what is in 
your mind
2) Set the goals of the project.
3) Open the source but maintain the leadership of the project.
4) Ask for cooperation
5) Build the comminication/documentation infrastructure .
I have read you are somehow confused about how to make revenues from 
your project. First of all lets alltogether finish it.
As you may know I am the creator of the REBOL2 DocBase section.

I have asked for long time the upgrade of the software to a later 
version which supports multiple languages.
Now 3 years have passed since then and no upgrade took place.

I am still with the same idea: I believe that documentation and communication 
is everything. If someone has the willingnes to setup a linux system 
with the proper wiki software I am ready to DONATE MONEY for hosting.
It will be the basis for World Documentation. You are a programmer 
and you know how much important is this aspect. I am sure we will 
find someone which could create the official World Web Site.
I am ready to read your opinions. Then will come my views about making 
money with your product.
Geomol
9-Dec-2011
[582x2]
Somewhere, in the road to version 1.0 you will need help. It belongs 
to you teling us when you will have clear in your mind the whole 
project. Then, please SHARE THE VISION and ask for cooperation and 
involvement of other programmers.


It's pretty clear in my mind, what version 1 is about. When I started, 
I wrote down the natives, which are really necessary to create a 
REBOL like language on a virtual machine. All the other functions 
should be able to be produced from this set of natives. I listed 
about 100. World currently has 83 natives implemented. Maybe some 
of them will get some more refinements before version 1, but you 
could say, the natives are 80% done.


You may think of this project as the Wildman project (see that group), 
not on native hardware, but on a virtual machine.
And I listed close to 50 datatypes. World currently operate with 
41 datatypes.
GiuseppeC
9-Dec-2011
[584x3]
As things are clear to you I suggest to spend a couple of days creating 
the White Paper, The structure of the programming language and the 
ROADMAP. You may think that you will loose 2 days but I am sure you 
will gain lot more.
Personally I have a great private project in mind and a skilled developer 
for it.

The project is blocked because he want to make money now and someone 
who finances the project.

I told him that First of all we must show a concept application. 
This will sell the application itself and we start fundraising.

Until something usable won't be ready I will not be able to sell 
the idea. He refuses this view and we are blocked.


As you are writing a programming language you are in a worst scenarion 
than us.

You need to have a commercial class programming language ready for 
the mass to sell it and this is not the case.

Commercial Class mean: IDE, Solution for interfacing SQL Databases, 
Solutions for communicating, Solutions for interfacing to other projects.

This is too much for one man to accomplish. You need to live, you 
need money and World is your Hobby project (Isn't it ?)


Open sourcing and delegating is the solution for creating a mature 
project: you seth the path, the specifications, the rules, the others 
will help.


I won't give a Penny and Time to REBOL Tech. because its source is 
closed and this model is wasting my precious life waiting for Carl 
to resurrect.

Open Sourcing solves this problem. Don't you think that if REBOL 
was open sourced many developers would have inproved it in Carls 
absence ? Do you think that someone, like an university will donate 
money to a private held project ? I don't think so.


When we (you) will have a mature project and you will be able to 
show to the world the advantages of your solutions money will come.

Think of SQL lite. There is a consortium behind it. Other open source 
solutions have the same consortiums behind them.


There are many ways to raise money: You can produce vertical solutions 
for your baby.You can give consulency to companies and other institutions, 
you can create products with World. These are few that comes into 
my mind.
I repeat: I am ready to cooperate once you will chose an open source 
 licence. I am ready to give money and TIME. Carl didn't seem to 
apreciate. Hope you will.