Question: Something is ... the html as text. 
Author Message
 Question: Something is ... the html as text.

This is a follow up to an earlier message in case the html didnt get
Here it is:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>A Language</TITLE>
<META NAME="Template" CONTENT="C:\Program Files\Microsoft
<BODY LINK="#0000ff" VLINK="#800080">

<B><U><FONT FACE="Arial" SIZE=5><P ALIGN="CENTER">&nbsp;</P>
<P ALIGN="CENTER">The Language Im Looking For</P>

<FONT SIZE=2><P ALIGN="CENTER">20. Feb. 98</P>
</FONT><B><U><FONT FACE="Arial"><P>Background</P>
</B></U></FONT><FONT SIZE=2><P>My project is a funny kind of math modeling
system for home users, in the first place geared toward financial planning,
but general enough to be used in other areas. I need a language to write it
in, or maybe the project is the language. On the surface it sounds like a
functional language.</P>
<P>It should accept functions defined in terms of one another, allow samples
to be generated, which are data (ie datums, like points on a graph) obtained
from executing a function with a specific value for the parameter, and keep
these samples up to date (ie dirty and callback the UI if necessary) in the
face of changes to other functions. </P>
</FONT><B><U><FONT FACE="Arial"><P>Desiderata in abstract.</P>
</B><FONT SIZE=2><P>Functions dont have to be defined. If they arent, they
evaluate to themselves. It might be that there is no definition at all, or
that some parameters are required. A number is just a special case of a
function anyway so why should this be a problem? I understand this to be the
main difference between what I want and a functional language, but it gives
us a neat way of dealing with dimensions and units. </P>
</B><FONT SIZE=2><P>In general were pushing expressions around and not
necessarily numbers. This means that we are doing algebraic symbol
manipulation. We can avoid providing pattern matching for the user but I
guess that would be the internals of an algebraic system. Dimensionality
will be dealt with one level above the basic symbol manipulator. We probably
dont want to keep the users original input (before it got algebraicly
simplified) but if we did, it would be as a cookie. I dont mind if this has
pushed me into using rational arithmetic instead of floats.</P>
</B><FONT SIZE=2><P>The language would take the form of an API on top of
which various types of visual editor could be built. The UI would write a
program in the language, via the api, ie stuff functions and data into it at
run time and make enquiries of them.  This is not the same as just exporting
a few of the defined functions.  The user's document <U>is</U> the
</FONT><B><P>One global database</P>
</B><FONT SIZE=2><P>The language would store the program in a single
database. Like a database it should avoid loading everything into main
memory if it hasnt been asked for. This becomes important when somebody is
using it store endless volumes of historical financial transactions.</P>
</B><FONT SIZE=2><P>These endless volumes would take the form of a function
definition divided into intervals of parameter values. It would help the
update mechanism if the definition for each interval was a separate function
with its own dirty flag.</P>
</FONT><B><P>Remote access</P>
</B><FONT SIZE=2><P>It should seamlessly support references to databases on
remote URLs. Even the update mechanism has to work over the remote
interface, which is complicated. Policies on deleting samples to recover
memory would vary from one datum to another.</P>
</FONT><B><P>Friendly syntax</P>
</B><FONT SIZE=2><P>Function definitions should be accepted in a friendly
syntax, preferably conforming to a well known standard like Excel.&nbsp;</P>
</B><FONT SIZE=2><P>Functions should be capable of holding auxilliary
information for the sake of the UI, which doesnt play a role in the math
model itself. </P>
</FONT><B><P>Type checking</P>
</B><FONT SIZE=2><P>The algebra is all dimensionless, but we can cobble
together a type check by asserting that expressions are defined. More
</FONT><B><U><FONT FACE="Arial"><P>Values / Expressions</P>
</B></U></FONT><FONT SIZE=2><P>To clarify the above points:</P>
</FONT><B><U><P>Undefined functions, dimensions and units</P>
</B></U><FONT SIZE=2><P>Declare a function without a definition:</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>dm</P>
</FONT><FONT SIZE=2><P>We know that:</P><DIR>

<P>100 * pf = 1 * dm</P>
<P>200 * pf = 2 * dm</P></DIR>

<P>So we can <U>define</U> another:</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>pf = dm / 100</P>
</FONT><FONT SIZE=2><P>Which has the desired result that:</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>200 pf = 200 dm / 100 = 2 dm</P>
</FONT><FONT SIZE=2><P>where the multiplication has been abbreviated.</P>
<P>Its not automatically ok to convert one currecy to another willy-nilly.
For instance I might deal with carrots and potatoes just like pounds and dm
so lets make another currency and see what happens if we add them
</FONT><FONT FACE="Fixedsys" SIZE=1><P>pound</P>
<P>pocket = 300 dm + 200 pound</P>
</FONT><FONT SIZE=2><P>and thats as far as we can reduce it, unless weve
got an exchange rate such as:</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>pound = 3 dm</P>
</FONT><FONT SIZE=2><P>If we now ask for pocket in terms of pounds we can
transpose the rate equation and simplify:</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>dm = pound / 3</P>
<P>&#9;= 300 dm + 200 pound</P><DIR>

<P>= 300 (pound / 3) + 200 pound</P>
<P>= 100 pound + 200 pound </P>
<P>= 300 pound</P></DIR>

</FONT><FONT SIZE=2><P>Asking for pocket i.t.o pound just means solving
</FONT><FONT FACE="Fixedsys" SIZE=1>pocket = X pound</FONT><FONT SIZE=2> for
</FONT><B><U><P>Parameters and type checking</P>
</B></U><FONT SIZE=2><P>A rudimentary date would be:</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>X * days</P>
</FONT><FONT SIZE=2><P>where days is undefined and X is supposed to mean
since 1900 or whatever.</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>today = 130 days</P>
</FONT><FONT SIZE=2><P>at least for the time being.</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>working(X) = ( 1 &lt;= (X/days % 7)
&lt;= 5 )</P>
</FONT><FONT SIZE=2><P>X is a new construct in the language. Its not a
function (defined or otherwise (this distinction is fading now anyway))
because that would be like </FONT><FONT FACE="Fixedsys"
SIZE=1>working(today)</FONT><FONT SIZE=2> which would return a value. We
could use a keyword to mean parameter, but I like to think of it as a local
<P>B-b-b-b-but it looks like we can throw anything for X! Heres the
</FONT><FONT FACE="Fixedsys" SIZE=1><P>working(X) = 1 &lt;= ([X/days] % 7)
&lt;= 5</P>
<P>[]</FONT><FONT SIZE=2> means it doesnt contain any undefined functions.
The assertion doesnt do anything if it still waiting for parameters,
because in this case the parameterised function eg:</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>[start_of_month(X)/days]</P>
</FONT><FONT SIZE=2><P>hasnt decided what to return yet. We could imagine a
</FONT><FONT FACE="Fixedsys" SIZE=1><P>dinner(X)=working(X) ? 3 apple : 4
banana </FONT><FONT SIZE=2>(or whatever syntax)</P>
<P>which would only barf at </FONT><FONT FACE="Fixedsys"
SIZE=1>[dinner(X)/apple]</FONT><FONT SIZE=2> on the weekend. I dont know if
I like this but on this line of reasoning theres no choice as far as I can
<P>In the example </FONT><CODE>([X/days] % 7)</CODE><FONT SIZE=2>; I think
the [] would be built into the % already.</P>
</FONT><FONT FACE="Fixedsys" SIZE=1><P>dailywage = 800 dm</P>
<P>earn(X) </P><DIR>

<P>= dailywage * working(X) </P>
<P>= 800 dm * working(X) </P></DIR>

<P>earn(today) </P><DIR>

<P>= dailywage * working(today) </P></DIR>

<P>&#9;= 800 dm * working(130 days) </P>
<P>&#9;= 800 dm * (1 &lt;= ([130 days/days] % 7) &lt;= 5)&#9;</P><DIR>

<P>= 800 dm * 0&#9;</P>
<P>= 0 * dm</P>
<P>?= 0 </FONT><FONT SIZE=2>I dunno yet</P>
</FONT><B><U><FONT FACE="Arial"><P>&nbsp;</P></DIR>

<P>Not sold yet?</P>
</B></U></FONT><FONT SIZE=2><P>Suppose the punter is trying to draw a graph
</FONT><FONT FACE="Fixedsys" SIZE=1><P>pocket(X) = [X/days] ** 2
dm</FONT><FONT SIZE=2> </P>
<P>ie quadratic increase.</P>
<P>He starts by calling the horizontal axis Time and putting 0, 1, 2, 3
along it. Nothing happens. So he calls the vertical axis pocket (Time).
Barf! It says "[Time / days]" which we can translate for him into "Time
should be in days". Now hes got two options. He can re-label the axis 1
days, 2 days etc, or he can re-name the axis Time / days. Thats what a
scientist would write. Now the answers come back from the function as 0 dm,
1 dm, 4 dm etc and the UI labels the axis accordingly: 1 dm, 2 dm, 3 dm etc.
If this annoys him he can re-name the vertical axis pocket(Time) / dm.
Then the answers come back as 1, 2, 4. Terribly logical isnt it!</P>

Wed, 08 Aug 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Some questions on elided text in the text widget (and a few other text widget questions)

2. I am trying to copy a text string from a front panel indicator to a text

3. I am trying to copy a text string from a front panel indicator to a text

4. Highlight specific text in HTML without touching HTML Tags

5. Am i missing something with CW5Pe?

6. Am I missing something here?

7. Am I missing something here?

8. Clarion 4 Scroll Bars - Am I Missing Something

9. Am I missing something in forth!

10. Haskell: am I missing something?

11. Am I doing something silly?

12. GNAT.Regexp: Am I missing something?


Powered by phpBB® Forum Software