| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Merlin (named after the famous British engine of my favourite British plane - the Spitfire) is the new compiler for Qi II. It has 4 speed settings - 0 to 3. FYI here is the Lisp object code for factorial at different settings. (define factorial {number --> number} 0 -> 1 X -> (* X (factorial (- X 1)))) speed 0 - no optimisations (DEFUN factorial (V891) (COND ((EQL 0 V891) 1) (T (* V891 (factorial (- V891 1))))))NIL : (list A) speed 1 - limited optimisations - optimise certain calls, reduce car/ cdring. This is the efault setting (DEFUN factorial (V896) (COND ((EQL 0 V896) 1) (T (* V896 (factorial (1- V896))))))NIL : (list A) speed 2 - optimise using type information (DEFUN factorial (V901) (COND ((ZEROP (THE NUMBER V901)) 1) (T (THE NUMBER (* (THE NUMBER V901) (THE NUMBER (factorial (THE NUMBER (1- (THE NUMBER V901)))))))))) speed 3 doesn't produce any change for this example, but it will effectively do for code what turbo-E did in addition to the preceding optimisations. Note speed > 1 assumes type integrity in your code and uses Qi type information to speed up your program, inserting type declarations and also exchanging Qi generic equality tests for much faster type specific ones. The whole system should be out by the end of the summer. Mark |
|
#2
| |||
| |||
| On Aug 10, 4:06*pm, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote: > Merlin (named after the famous British engine of my favourite British > plane - the Spitfire) Why does everybody seem to forgeth the backbone of RAF, Hawker Hurricane. That was also powered by Rolls Royce Merlin. >is the new compiler for Qi II. It has 4 speed > settings - 0 to 3. *FYI here is the Lisp object code for factorial at > different settings. > > (define factorial > * * * * {number --> number} > * * * * *0 -> 1 > * * * * *X -> (* X (factorial (- X 1)))) > > speed 0 - no optimisations > > (DEFUN factorial (V891) > *(COND ((EQL 0 V891) 1) (T (* V891 (factorial (- V891 1))))))NIL : > (list A) > > speed 1 - limited optimisations - optimise certain calls, reduce car/ > cdring. > * * * * * This is the efault setting > > (DEFUN factorial (V896) > *(COND ((EQL 0 V896) 1) (T (* V896 (factorial (1- V896))))))NIL : > (list A) > > speed 2 - optimise using type information > > (DEFUN factorial (V901) > *(COND ((ZEROP (THE NUMBER V901)) 1) > * (T > * *(THE NUMBER > * * (* (THE NUMBER V901) > * * *(THE NUMBER (factorial (THE NUMBER (1- (THE NUMBER V901)))))))))) > > speed 3 doesn't produce any change for this example, but it will > effectively do for code what turbo-E did in addition to the preceding > optimisations. > > Note speed > 1 assumes type integrity in your code and uses Qi type > information to speed up your program, inserting type declarations and > also exchanging Qi generic equality tests for much faster type > specific ones. > > The whole system should be out by the end of the summer. > > Mark |
|
#3
| |||
| |||
| Slobodan Blazeski wrote: > On Aug 10, 4:06 pm, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote: >> Merlin (named after the famous British engine of my favourite British >> plane - the Spitfire) > Why does everybody seem to forgeth the backbone of RAF, Hawker > Hurricane. That was also powered by Rolls Royce Merlin. Two lines into an important FP announcement and all Slobby wants to talk about is WW II aircraft engines? This is sad. So sad. Lisp is alive and well in Ruby, Python, and Groovy. Lispers? A moment of silence... kt >> is the new compiler for Qi II. It has 4 speed >> settings - 0 to 3. FYI here is the Lisp object code for factorial at >> different settings. >> >> (define factorial >> {number --> number} >> 0 -> 1 >> X -> (* X (factorial (- X 1)))) >> >> speed 0 - no optimisations >> >> (DEFUN factorial (V891) >> (COND ((EQL 0 V891) 1) (T (* V891 (factorial (- V891 1))))))NIL : >> (list A) >> >> speed 1 - limited optimisations - optimise certain calls, reduce car/ >> cdring. >> This is the efault setting >> >> (DEFUN factorial (V896) >> (COND ((EQL 0 V896) 1) (T (* V896 (factorial (1- V896))))))NIL : >> (list A) >> >> speed 2 - optimise using type information >> >> (DEFUN factorial (V901) >> (COND ((ZEROP (THE NUMBER V901)) 1) >> (T >> (THE NUMBER >> (* (THE NUMBER V901) >> (THE NUMBER (factorial (THE NUMBER (1- (THE NUMBER V901)))))))))) >> >> speed 3 doesn't produce any change for this example, but it will >> effectively do for code what turbo-E did in addition to the preceding >> optimisations. >> >> Note speed > 1 assumes type integrity in your code and uses Qi type >> information to speed up your program, inserting type declarations and >> also exchanging Qi generic equality tests for much faster type >> specific ones. >> >> The whole system should be out by the end of the summer. >> >> Mark > -- $$$$$: http://www.theoryyalgebra.com/ Cells: http://common-lisp.net/project/cells/ BSlog: http://smuglispweeny.blogspot.com/ |
|
#4
| |||
| |||
| What do you need to be able to integrate Qi type system in a language? I'm working on my language and still haven't decided about type system. I would like to have a static checks, (if they are optional) but the best from what I found is http://www.cs.utexas.edu/users/boyer/ftp/diss/akers.pdf that comes with a huge price of flexibility that I'm not willing to pay. I looked at your 10 cent typechecker but the functions defined there are simple, edis' are heavily overloaded. For example even simple + could be called, in array style: (+ 2 '( 1 2 3)) (3 4 5) (+ '(1 2 3) '(1 2 3)) (2 4 6) (+ '(1 2) '((0 1) (2 3) (4 5))) ((1 5) (2 6) (3 7)) Or they could be completely redefined or even removed at runtime.Nothing prevents user to do things like below at runtime: (def triple (x) (* 3 x)) triple (remove triple '(x)) t Also there is even more transformation characters that are making the problem. (def add (x y z) (fold + x y z)) add (+ 2 3 _) ; creates projection (lambda (x) (add 2 3 x)) Is static typechecking possible in so volatile enviroment? bobi |
|
#5
| |||
| |||
| On 11 Aug, 09:12, Slobodan Blazeski <slobodan.blaze...@gmail.com> wrote: > On Aug 10, 4:06*pm, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote:> Merlin (named after the famous British engine of my favourite British > > plane - the Spitfire) > > Why does everybody seem to forgeth the backbone of RAF, Hawker > Hurricane. That was also powered by *Rolls Royce Merlin. > > > > >is the new compiler for Qi II. It has 4 speed > > settings - 0 to 3. *FYI here is the Lisp object code for factorial at > > different settings. > > > (define factorial > > * * * * {number --> number} > > * * * * *0 -> 1 > > * * * * *X -> (* X (factorial (- X 1)))) > > > speed 0 - no optimisations > > > (DEFUN factorial (V891) > > *(COND ((EQL 0 V891) 1) (T (* V891 (factorial (- V891 1))))))NIL : > > (list A) > > > speed 1 - limited optimisations - optimise certain calls, reduce car/ > > cdring. > > * * * * * This is the efault setting > > > (DEFUN factorial (V896) > > *(COND ((EQL 0 V896) 1) (T (* V896 (factorial (1- V896))))))NIL : > > (list A) > > > speed 2 - optimise using type information > > > (DEFUN factorial (V901) > > *(COND ((ZEROP (THE NUMBER V901)) 1) > > * (T > > * *(THE NUMBER > > * * (* (THE NUMBER V901) > > * * *(THE NUMBER (factorial (THE NUMBER (1- (THE NUMBER V901)))))))))) > > > speed 3 doesn't produce any change for this example, but it will > > effectively do for code what turbo-E did in addition to the preceding > > optimisations. > > > Note speed > 1 assumes type integrity in your code and uses Qi type > > information to speed up your program, inserting type declarations and > > also exchanging Qi generic equality tests for much faster type > > specific ones. > > > The whole system should be out by the end of the summer. > > > Mark- Hide quoted text - > > - Show quoted text - Indeed, but you know it never had the beautiful lines of the Spitfire - the elliptical wings and the dihedral slant that made it so pretty. It as essentially an older design in concept. As you say it did however have the same Merlin engine that its sister aircraft had. |
|
#6
| |||
| |||
| On Aug 11, 10:56*am, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote: > On 11 Aug, 09:12, Slobodan Blazeski <slobodan.blaze...@gmail.com> > > Why does everybody seem to forgeth the backbone of RAF, Hawker > > Hurricane. That was also powered by *Rolls Royce Merlin. > > Indeed, but you know it never had the beautiful lines of the Spitfire > - the elliptical wings and the dihedral slant that made it so pretty. > It as essentially an older design in concept. As you say it did > however have the same Merlin engine that its sister aircraft had.- Hide quoted text - Sorry I was little bit nostalgic, Hurricane was my favourite childhood toy and only memory from my grand-grandfather. He emigrated in England in start of WW2 and never came back. |
|
#7
| |||
| |||
| On 11 Aug, 09:56, Slobodan Blazeski <slobodan.blaze...@gmail.com> wrote: > What do you need to be able to integrate Qi type system in a > language? *I'm working on my language and still haven't decided about > type *system. *I would like to have a static checks, (if they are > optional) but the best from what I found ishttp://www.cs.utexas.edu/users/boyer/ftp/diss/akers.pdfthat comes > with a huge price of flexibility that I'm not willing to pay. I looked > at your 10 cent typechecker but the functions defined there are > simple, edis' are heavily overloaded. For example even simple + could > be called, in array style: > (+ 2 '( 1 2 3)) > (3 4 5) > > (+ '(1 2 3) '(1 2 3)) > (2 4 6) > > (+ '(1 2) '((0 1) (2 3) (4 5))) > ((1 5) (2 6) (3 7)) > > Or they could be completely redefined or even removed at > runtime.Nothing prevents user to do things like below at runtime: > (def triple (x) (* 3 x)) > triple > (remove triple '(x)) > t > > *Also there is even more transformation characters that are making the > problem. > (def add (x y z) (fold + x y z)) > add > (+ 2 3 _) ; creates projection > (lambda (x) (add 2 3 x)) > > Is static typechecking possible in so volatile enviroment? > > bobi Yes; what you have got is severe overloading; but its not a problem. There is nothing to stop you using several rules to express the type properties of one function. Qi will use the one that fits the individual case using backtracking if needed. The argument against overloading is that, if you have many overloaded functions, type checking becomes slower because there is a roughly linear depreciation in performance wrt the number of rules you use. But Qi has handled complex type systems and it does work successfully because the underlying technology is so fast in human terms that it takes quite a few rules before you really notice the lag. If you avoid overloading, then you can follow the Qi design of placing type information about functions on a hash table as closures. This effectively means that there is no depreciation wrt the number of system functions that the language contains. Mark . |
|
#8
| |||
| |||
| On Aug 11, 11:19*am, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote: > On 11 Aug, 09:56, Slobodan Blazeski <slobodan.blaze...@gmail.com> > wrote: > > > > > > > What do you need to be able to integrate Qi type system in a > > language? *I'm working on my language and still haven't decided about > > type *system. *I would like to have a static checks, (if they are > > optional) but the best from what I found ishttp://www.cs.utexas.edu/users/boyer/ftp/diss/akers.pdfthatcomes > > with a huge price of flexibility that I'm not willing to pay. I looked > > at your 10 cent typechecker but the functions defined there are > > simple, edis' are heavily overloaded. For example even simple + could > > be called, in array style: > > (+ 2 '( 1 2 3)) > > (3 4 5) > > > (+ '(1 2 3) '(1 2 3)) > > (2 4 6) > > > (+ '(1 2) '((0 1) (2 3) (4 5))) > > ((1 5) (2 6) (3 7)) > > > Or they could be completely redefined or even removed at > > runtime.Nothing prevents user to do things like below at runtime: > > (def triple (x) (* 3 x)) > > triple > > (remove triple '(x)) > > t > > > *Also there is even more transformation characters that are making the > > problem. > > (def add (x y z) (fold + x y z)) > > add > > (+ 2 3 _) ; creates projection > > (lambda (x) (add 2 3 x)) > > > Is static typechecking possible in so volatile enviroment? > > > bobi > > Yes; what you have got is severe overloading; but its not a problem. > There is nothing to stop you using several rules to express the type > properties of one function. *Qi will use the one that fits the > individual case using backtracking if needed. > > The argument against overloading is that, if you have many overloaded > functions, type checking becomes slower because there is a roughly > linear depreciation in performance wrt the number of rules you use. > But Qi has handled complex type systems and it does work successfully > because the underlying technology is so fast in human terms that it > takes quite a few rules before you really notice the lag. > > If you avoid overloading, then you can follow the Qi design of placing > type information about functions on a hash table as closures. *This > effectively means that there is no depreciation wrt the number of > system functions that the language contains. > > Mark > Could you please enlighten me a little bit more. As per my very limited exposure to Haskell and MLs type inference works because functions are defined at compile time and runtime is only using them. Am I right? Edi carries the whole implementation with it all the time and uses it to create all the objects at the runtime. Building and removing functions at runtime via macros (called at runtime), other functions, transformers, projections,weaving them is a normal way of doing business. Maybe a little comparation with a baker that plans to sell some of his staff at the local fare. Statically typed baker will decide what products to carry and premade them. That's why his staff will be faster. Edi type baker will make some products but also it will bring it's bakery with it, and cook the meals on the spot, it takes longer but the food is always hot. Is it what you saying that I could statically check only the prefabricated functions bobi |
|
#9
| |||
| |||
| On 11 Aug, 10:57, Slobodan Blazeski <slobodan.blaze...@gmail.com> wrote: > On Aug 11, 11:19*am, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote: > > > > > > > On 11 Aug, 09:56, Slobodan Blazeski <slobodan.blaze...@gmail.com> > > wrote: > > > > What do you need to be able to integrate Qi type system in a > > > language? *I'm working on my language and still haven't decided about > > > type *system. *I would like to have a static checks, (if they are > > > optional) but the best from what I found ishttp://www.cs.utexas.edu/users/boyer/ftp/diss/akers.pdfthatcomes > > > with a huge price of flexibility that I'm not willing to pay. I looked > > > at your 10 cent typechecker but the functions defined there are > > > simple, edis' are heavily overloaded. For example even simple + could > > > be called, in array style: > > > (+ 2 '( 1 2 3)) > > > (3 4 5) > > > > (+ '(1 2 3) '(1 2 3)) > > > (2 4 6) > > > > (+ '(1 2) '((0 1) (2 3) (4 5))) > > > ((1 5) (2 6) (3 7)) > > > > Or they could be completely redefined or even removed at > > > runtime.Nothing prevents user to do things like below at runtime: > > > (def triple (x) (* 3 x)) > > > triple > > > (remove triple '(x)) > > > t > > > > *Also there is even more transformation characters that are making the > > > problem. > > > (def add (x y z) (fold + x y z)) > > > add > > > (+ 2 3 _) ; creates projection > > > (lambda (x) (add 2 3 x)) > > > > Is static typechecking possible in so volatile enviroment? > > > > bobi > > > Yes; what you have got is severe overloading; but its not a problem. > > There is nothing to stop you using several rules to express the type > > properties of one function. *Qi will use the one that fits the > > individual case using backtracking if needed. > > > The argument against overloading is that, if you have many overloaded > > functions, type checking becomes slower because there is a roughly > > linear depreciation in performance wrt the number of rules you use. > > But Qi has handled complex type systems and it does work successfully > > because the underlying technology is so fast in human terms that it > > takes quite a few rules before you really notice the lag. > > > If you avoid overloading, then you can follow the Qi design of placing > > type information about functions on a hash table as closures. *This > > effectively means that there is no depreciation wrt the number of > > system functions that the language contains. > > > Mark > > Could you please enlighten me a little bit more. As per my very > limited exposure to Haskell and MLs type inference works because > functions are defined at compile time and runtime is only using them. > Am I right? Edi carries the whole implementation with it all the time > and uses it to *create all the objects at the runtime. Building and > removing *functions at runtime via macros (called at runtime), other > functions, transformers, projections,weaving them is a normal way of > doing business. > Maybe a little comparation with a baker that plans to sell some of his > staff at the local fare. > Statically typed baker will decide what products to carry and premade > them. That's why his staff will be faster. > Edi type baker will make some products but also it *will bring it's > bakery with it, and *cook the meals on the spot, it takes longer but > the food is always hot. > Is it what you saying that I could statically check only the > prefabricated functions > bobi- Hide quoted text - > > - Show quoted text - > edis' are heavily overloaded Is edis your language? OK; lets take the first two examples (+ 2 '( 1 2 3)) (3 4 5) (+ '(1 2 3) '(1 2 3)) (2 4 6) I take it that (+ 2 2) still works! Hence there are three signatures that you can put in for +. (datatype plus ___________________________________ + : (number --> number --> number); ______________________________________ + : (number --> [number] --> [number]); _______________________________________ + : ([number] --> [number] --> [number]) ![]() However from your examples it looks like your + is not ad hoc overloaded but actually works over a recursive type composed of numbers or lists of numbers or lists of lists of numbers etc. So what you need to do in order to capture the properties of this function is to define that recursive type. > Or they could be completely redefined or even removed at > runtime. Well type checking functions that are overwritten during runtime does pose problems for type integrity! However it is still possible to maintain type integrity with this feature provided that the new function maintains the same type as the old one. In this case you will want to invoke the type checker dynamically at run time. Mark |
|
#10
| |||
| |||
| On Aug 11, 12:48*pm, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote: > On 11 Aug, 10:57, Slobodan Blazeski <slobodan.blaze...@gmail.com> > wrote: > > > > > > > On Aug 11, 11:19*am, Mark Tarver <dr.mtar...@ukonline.co.uk> wrote: > > > > On 11 Aug, 09:56, Slobodan Blazeski <slobodan.blaze...@gmail.com> > > > wrote: > > > > > What do you need to be able to integrate Qi type system in a > > > > language? *I'm working on my language and still haven't decided about > > > > type *system. *I would like to have a static checks, (if they are > > > > optional) but the best from what I found ishttp://www.cs.utexas.edu/users/boyer/ftp/diss/akers.pdfthatcomes > > > > with a huge price of flexibility that I'm not willing to pay. I looked > > > > at your 10 cent typechecker but the functions defined there are > > > > simple, edis' are heavily overloaded. For example even simple + could > > > > be called, in array style: > > > > (+ 2 '( 1 2 3)) > > > > (3 4 5) > > > > > (+ '(1 2 3) '(1 2 3)) > > > > (2 4 6) > > > > > (+ '(1 2) '((0 1) (2 3) (4 5))) > > > > ((1 5) (2 6) (3 7)) > > > > > Or they could be completely redefined or even removed at > > > > runtime.Nothing prevents user to do things like below at runtime: > > > > (def triple (x) (* 3 x)) > > > > triple > > > > (remove triple '(x)) > > > > t > > > > > *Also there is even more transformation characters that are making the > > > > problem. > > > > (def add (x y z) (fold + x y z)) > > > > add > > > > (+ 2 3 _) ; creates projection > > > > (lambda (x) (add 2 3 x)) > > > > > Is static typechecking possible in so volatile enviroment? > > > > > bobi > > > > Yes; what you have got is severe overloading; but its not a problem. > > > There is nothing to stop you using several rules to express the type > > > properties of one function. *Qi will use the one that fits the > > > individual case using backtracking if needed. > > > > The argument against overloading is that, if you have many overloaded > > > functions, type checking becomes slower because there is a roughly > > > linear depreciation in performance wrt the number of rules you use. > > > But Qi has handled complex type systems and it does work successfully > > > because the underlying technology is so fast in human terms that it > > > takes quite a few rules before you really notice the lag. > > > > If you avoid overloading, then you can follow the Qi design of placing > > > type information about functions on a hash table as closures. *This > > > effectively means that there is no depreciation wrt the number of > > > system functions that the language contains. > > > > Mark > > > Could you please enlighten me a little bit more. As per my very > > limited exposure to Haskell and MLs type inference works because > > functions are defined at compile time and runtime is only using them. > > Am I right? Edi carries the whole implementation with it all the time > > and uses it to *create all the objects at the runtime. Building and > > removing *functions at runtime via macros (called at runtime), other > > functions, transformers, projections,weaving them is a normal way of > > doing business. > > Maybe a little comparation with a baker that plans to sell some of his > > staff at the local fare. > > Statically typed baker will decide what products to carry and premade > > them. That's why his staff will be faster. > > Edi type baker will make some products but also it *will bring it's > > bakery with it, and *cook the meals on the spot, it takes longer but > > the food is always hot. > > Is it what you saying that I could statically check only the > > prefabricated functions > > bobi- Hide quoted text - > > > - Show quoted text - > > edis' are heavily overloaded > > Is edis your language? Yeah edi. It's named after Edi Weitz. I wanted to name it by some lisper using some objective criterium so I picked the name of the author with most lisp libraries in my folder. The second place was gary as I have a lot of Gary King libs. Afterward the numbers were close: slava, marco,... The names that were already taken as pascal were not considered. > > OK; lets take the first two examples > > (+ 2 '( 1 2 3)) > (3 4 5) > > (+ '(1 2 3) '(1 2 3)) > (2 4 6) > > I take it that (+ 2 2) still works! *Hence there are three signatures > that you can put in for +. > > (datatype plus > > * * ___________________________________ > * * + : (number --> number --> number); > > * * ______________________________________ > * * + : (number --> [number] --> [number]); > > * * _______________________________________ > * * + : ([number] --> [number] --> [number]) ![]() > > However from your examples it looks like your + is not ad hoc > overloaded but actually works over a recursive type composed of > numbers or lists of numbers or lists of lists of numbers etc. *So what > you need to do in order to capture the properties of this function is > to define that recursive type. > > > Or they could be completely redefined or even removed at > > runtime. > > Well type checking functions that are overwritten during runtime does > pose problems for type integrity! *However it is still possible to > maintain type integrity with this feature provided that the new > function maintains the same type as the old one. *In this case you > will want to invoke the type checker dynamically at run time. Dynamical type checker. I like that. > > Mark- Hide quoted text - > > - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.