|
Froglingo |
|
A programming language empowered by a total-recursive-equivalent data model |
|
|
|
|
|
|
As a DBMS and a Programming Language
For an Information Community
For Internet Access
Case Study 1: College Student Registration
Case Study 2: Communications Between Community, Sales, and
Shipping organizations
Case Study 3: A Web Console
As a
DBMS and a Programming Language
A string or a number
is simply echoed:
[//]
"Hello World";
"Hello
World";
Regular arithmetic
calculations are supported:
[//] 3 + 5;
8;
Data
is constructed by using a built-in operator create:
[//] create John salary = 1000;
[//] create Dave salary = 2000;
Queries on entered
data are available immediately:
[//] John salary;
1000;
[//] Johan salary + Dave salary;
3000;
[//] select $person, $person salary where $person salary >=1000;
John,
1000
Dave,
2000;
Business logic (or
infinite data) is stored as data too:
[//]
create tax $money = ($money * 0.3);
[//] select $person, $persin salary, tax ($person
salary)
where $person salary >= 100;
John,
1000, 300
Dave,
2000, 600;
Another example of
business logic - a factorial function:
[//] create fac 0 =
1;
[//] create fac $n:[$n > 0] = ($n * (fac ($n - 1)));
[//] fac 4;
24;
A set of built-in
operators are applicable to Froglingo data. They are
more powerful than those existed in the traditional DBMSs
such as SQL. Queries against a directed graph is a typical example:
[//]
create A; /* define a vertex 'A' */
[//] create B; /* define a vertex 'B' */
[//] create C; /* define a vertex 'C' */
[//] create A B = B; /* define a directed connection A -> B */
[//] create B C = C; /* define a directed connection B -> C */
Query: Is there a
path from vertices A to C?
[//]
A >=+ C;
true;
Froglingo manages files and a HTML
file can be embedded with Froglingo expressions.
Suppose there is a file myprofile.html
and the content is:
<frog> $name </frog> <!—- a parameter passing
through the file -->
<html>
<body background=”photo.jpg”>
My name is
<frog>
$name </frog>
and my
salary is
<frog>
$name salary </frog>
</body>
</html>
It can be loaded by using load command:
[//]
load myprofile.html;
The
data entered to Froglingo database is not shared with
anyone else unless you explicitly granted permission to other people. The first
step is to setup a multi-user environment by giving a password to you as the
root user and then by adding additional users:
[//]
passwd;
New
Passwd: ******
Confirm
Passwd: ******
Now you are acting as the most privileged user // (or equivalently root);
and you are ready to create additional user accounts:
[//]
addusr john;
The
passwd is: un@Ik8l2
[//]
addusr www.myclienta.com;
The
passwd is: kkjkadsf
[//]
quit;
The last command quit terminates the Froglingo
process. Now you may login again with a different user account.
C:\Froglingo\frog.exe
User
Id: www.myclienta.com
Passwd: ********
Confirm
passwd: ********
[//www.myclienta.com]
Under the stand //www.myclienta.com, you are ready to construct your business
application.
To demonstrate how Froglingo
supports web browsers, let’s continue with a few more tasks:
[//www.myclienta.com]
load photo.jpg;
[//www.myclienta.com]
load index.html;
[//www.myclienta.com]
print index.html;
index.html
=
<html>
<body>
Welcome to Froglingo,
a unified solution for database management, programming, file system, and web
access.
</body>
</html>;
[//www.myclienta.com]
grtacc index.html anyone;
[//www.myclienta.com]
quit;
The command grtacc above assigned anyone to have the
access permission on index.html.
Now any user can view the web page via a web browser across network as soon as
a Froglingo web server is started via a CMD window:
C:\\Froglingo\frog.exe
–p 80
Assume that the user account www.myclienta.com also has been
registered as a domain name via a domain name registration agency,
you are ready to user a web browser to interact with the web server by entering
URIs embedding Froglingo
expressions. Here are an example:
http://www.myclienta.com/index.html