From 23d870c8b628e48d8d20f532fe5e877cbaa79d40 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 4 May 2021 21:45:55 +0100 Subject: Add Perl Poetry post --- content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi | 143 ++++++++++++++++++++ content/gemtext/gemfeed/atom.xml | 13 +- content/gemtext/index.gmi | 1 + content/html/gemfeed/2008-06-26-perl-poetry.html | 150 +++++++++++++++++++++ content/html/gemfeed/atom.xml | 13 +- content/html/index.html | 1 + content/meta/gemfeed/2008-06-26-perl-poetry.meta | 5 + 7 files changed, 324 insertions(+), 2 deletions(-) create mode 100644 content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi create mode 100644 content/html/gemfeed/2008-06-26-perl-poetry.html create mode 100644 content/meta/gemfeed/2008-06-26-perl-poetry.meta diff --git a/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi new file mode 100644 index 00000000..ea936b91 --- /dev/null +++ b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi @@ -0,0 +1,143 @@ +> Written by Paul Buetow 2008-06-26 + +=> ../ Go back to the main site + +# Perl Poetry + +Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax. + +Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks." + +=> https://en.wikipedia.org/wiki/Perl + +## math.pl + +``` +#!/usr/bin/perl + +# (C) 2006 by Paul C. Buetow (http://paul.buetow.org) + +goto library for study $math; +BEGIN { s/earching/ books/ +and read $them, $at, $the } library: + +our $topics, cos and tan, +require strict; import { of, tied $patience }; + +do { int'egrate'; sub trade; }; +do { exp'onentize' and abs'olutize' }; +study and study and study and study; + +foreach $topic ({of, math}) { +you, m/ay /go, to, limits } + +do { not qw/erk / unless $success +and m/ove /o;$n and study }; + +do { int'egrate'; sub trade; }; +do { exp'onentize' and abs'olutize' }; +study and study and study and study; + +grep /all/, exp'onents' and cos'inuses'; +/seek results/ for @all, log'4rithms'; + +'you' =~ m/ay /go, not home +unless each %book ne#ars +$completion; + +do { int'egrate'; sub trade; }; +do { exp'onentize' and abs'olutize' }; + +#at +home: //ig,'nore', time and sleep $very =~ s/tr/on/g; +__END__ + +``` + +## christmas.pl + +``` +#!/usr/bin/perl + +# (C) 2006 by Paul C. Buetow (http://paul.buetow.org) + +Christmas:{time;#!!! + +Children: do tell $wishes; + +Santa: for $each (@children) { +BEGIN { read $each, $their, wishes and study them; use Memoize#ing + +} use constant gift, 'wrapping'; +package Gifts; pack $each, gift and bless $each and goto deliver +or do import if not local $available,!!! HO, HO, HO; + +redo Santa, pipe $gifts, to_childs; +redo Santa and do return if last one, is, delivered; + +deliver: gift and require diagnostics if our $gifts ,not break; +do{ use NEXT; time; tied $gifts} if broken and dump the, broken, ones; +The_children: sleep and wait for (each %gift) and try { to => untie $gifts }; + +redo Santa, pipe $gifts, to_childs; +redo Santa and do return if last one, is, delivered; + +The_christmas_tree: formline s/ /childrens/, $gifts; +alarm and warn if not exists $Christmas{ tree}, @t, $ENV{HOME}; +write < $sell }; +for $their (@business) { to:; earn:; a:; lot:; of:; money: } + +do not goto home and exit mall if exists $new{product}; +foreach $of (q(uality rich products)){} package products; + +our $news; do tell cool products() and do{ sub#tract +cool{ $products and shift @the, @bad, @ones; + +do bless [q(uality)], $products +and return not undef $stuff if not (local $available) }}; + +do { study and study and study for cool products() } +and do { seek $all, cool products(), { to => $buy } }; + +do { write $them, $down } and do { order: foreach (@case) { package s } }; +goto home if not exists $more{money} or die q(uerying) ;for( @money){}; + +at:;home: do { END{} and:; rest:; a:; bit: exit $shopping } +and sleep until unpack$ing, cool products(); + +__END__ +This is perl, v5.8.8 built for i386-freebsd-64int +``` + +## More... + +Did you like what you saw? Have a look at Github to see my other poems too: + +=> https://github.com/snonux/perl-poetry + +E-Mail me your thoughts at comments@mx.buetow.org! diff --git a/content/gemtext/gemfeed/atom.xml b/content/gemtext/gemfeed/atom.xml index b5fbe934..de608389 100644 --- a/content/gemtext/gemfeed/atom.xml +++ b/content/gemtext/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2021-05-03T10:06:42+01:00 + 2021-05-04T21:44:21+01:00 buetow.org feed Having fun with computers! @@ -72,4 +72,15 @@ comments@mx.buetow.org + + Perl Poetry + + gemini://buetow.org/gemfeed/2008-06-26-perl-poetry.gmi + 2008-06-26T21:43:51+01:00 + Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax.. .....to read on please visit my site. + + Paul Buetow + comments@mx.buetow.org + + diff --git a/content/gemtext/index.gmi b/content/gemtext/index.gmi index 15752c19..0d69bd80 100644 --- a/content/gemtext/index.gmi +++ b/content/gemtext/index.gmi @@ -57,3 +57,4 @@ I have switched blog software multiple times. I might be back filling some of th => ./gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi 2016-05-22 Spinning up my own authoritative DNS servers => ./gemfeed/2016-04-16-offsite-backup-with-zfs-part2.gmi 2016-04-16 Offsite backup with ZFS (Part 2) => ./gemfeed/2016-04-03-offsite-backup-with-zfs.gmi 2016-04-03 Offsite backup with ZFS +=> ./gemfeed/2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry diff --git a/content/html/gemfeed/2008-06-26-perl-poetry.html b/content/html/gemfeed/2008-06-26-perl-poetry.html new file mode 100644 index 00000000..45658370 --- /dev/null +++ b/content/html/gemfeed/2008-06-26-perl-poetry.html @@ -0,0 +1,150 @@ + + + +Having fun with computers! + + + + + +
Written by Paul Buetow 2008-06-26
+Go back to the main site
+

Perl Poetry

+

Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax.

+

Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."

+https://en.wikipedia.org/wiki/Perl
+

math.pl

+
+#!/usr/bin/perl
+
+# (C) 2006 by Paul C. Buetow (http://paul.buetow.org) 
+
+goto library for study $math;
+BEGIN { s/earching/ books/ 
+and read $them, $at, $the } library:
+
+our $topics, cos and tan, 
+require strict; import { of, tied $patience };
+
+do { int'egrate'; sub trade; };
+do { exp'onentize' and abs'olutize' };
+study and study and study and study;
+
+foreach $topic ({of, math}) {
+you, m/ay /go, to, limits }
+
+do { not qw/erk / unless $success 
+and m/ove /o;$n and study };
+
+do { int'egrate'; sub trade; };
+do { exp'onentize' and abs'olutize' };
+study and study and study and study;
+
+grep /all/, exp'onents' and cos'inuses';
+/seek results/ for @all, log'4rithms';
+
+'you' =~ m/ay /go, not home 
+unless each %book ne#ars
+$completion;
+
+do { int'egrate'; sub trade; };
+do { exp'onentize' and abs'olutize' };
+
+#at
+home: //ig,'nore', time and sleep $very =~ s/tr/on/g;
+__END__
+
+
+

christmas.pl

+
+#!/usr/bin/perl
+
+# (C) 2006 by Paul C. Buetow (http://paul.buetow.org) 
+
+Christmas:{time;#!!!
+
+Children: do tell $wishes;
+
+Santa: for $each (@children) { 
+BEGIN { read $each, $their, wishes and study them; use Memoize#ing
+
+} use constant gift, 'wrapping'; 
+package Gifts; pack $each, gift and bless $each and goto deliver
+or do import if not local $available,!!! HO, HO, HO;
+
+redo Santa, pipe $gifts, to_childs;
+redo Santa and do return if last one, is, delivered; 
+
+deliver: gift and require diagnostics if our $gifts ,not break;
+do{ use NEXT; time; tied $gifts} if broken and dump the, broken, ones;
+The_children: sleep and wait for (each %gift) and try { to => untie $gifts };
+
+redo Santa, pipe $gifts, to_childs;
+redo Santa and do return if last one, is, delivered; 
+
+The_christmas_tree: formline s/ /childrens/, $gifts;
+alarm and warn if not exists $Christmas{ tree}, @t, $ENV{HOME};  
+write <<EMail
+ to the parents to buy a new christmas tree!!!!111
+ and send the
+EMail
+;wait and redo deliver until defined local $tree;
+
+redo Santa, pipe $gifts, to_childs;
+redo Santa and do return if last one, is, delivered ;}
+
+END {} our $mission and do sleep until next Christmas ;}
+
+__END__
+
+This is perl, v5.8.8 built for i386-freebsd-64int
+
+

shopping.pl

+
+#!/usr/bin/perl
+
+# (C) 2007 by Paul C. Buetow (http://paul.buetow.org) 
+
+BEGIN{} goto mall for $shopping; 
+
+m/y/; mall: seek$s, cool products(), { to => $sell };
+for $their (@business) { to:; earn:; a:; lot:; of:; money: }
+
+do not goto home and exit mall if exists $new{product};
+foreach $of (q(uality rich products)){} package products; 
+
+our $news; do tell cool products() and do{ sub#tract
+cool{ $products and shift @the, @bad, @ones;
+
+do bless [q(uality)], $products 
+and return not undef $stuff if not (local $available) }};
+
+do { study and study and study for cool products() }
+and do { seek $all, cool products(), { to => $buy } };
+
+do { write $them, $down } and do { order: foreach (@case) { package s } };
+goto home if not exists $more{money} or die q(uerying) ;for( @money){};
+
+at:;home: do { END{} and:; rest:; a:; bit: exit $shopping } 
+and sleep until unpack$ing, cool products();
+
+__END__
+This is perl, v5.8.8 built for i386-freebsd-64int
+
+

More...

+

Did you like what you saw? Have a look at Github to see my other poems too:

+https://github.com/snonux/perl-poetry
+

E-Mail me your thoughts at comments@mx.buetow.org!

+ + diff --git a/content/html/gemfeed/atom.xml b/content/html/gemfeed/atom.xml index 2d43cf31..d3643b93 100644 --- a/content/html/gemfeed/atom.xml +++ b/content/html/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2021-05-03T10:04:48+01:00 + 2021-05-04T21:44:21+01:00 buetow.org feed Having fun with computers! @@ -72,4 +72,15 @@ comments@mx.buetow.org + + Perl Poetry + + https://buetow.org/gemfeed/2008-06-26-perl-poetry.html + 2008-06-26T21:43:51+01:00 + Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax.. .....to read on please visit my site. + + Paul Buetow + comments@mx.buetow.org + + diff --git a/content/html/index.html b/content/html/index.html index 99d03f62..2f6129af 100644 --- a/content/html/index.html +++ b/content/html/index.html @@ -61,5 +61,6 @@ li { color: #98be65; } 2016-05-22 Spinning up my own authoritative DNS servers
2016-04-16 Offsite backup with ZFS (Part 2)
2016-04-03 Offsite backup with ZFS
+2008-06-26 Perl Poetry
diff --git a/content/meta/gemfeed/2008-06-26-perl-poetry.meta b/content/meta/gemfeed/2008-06-26-perl-poetry.meta new file mode 100644 index 00000000..9238d83a --- /dev/null +++ b/content/meta/gemfeed/2008-06-26-perl-poetry.meta @@ -0,0 +1,5 @@ +local meta_date="2008-06-26T21:43:51+01:00" +local meta_author="Paul Buetow" +local meta_email="comments@mx.buetow.org" +local meta_title="Perl Poetry" +local meta_summary="Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax.. .....to read on please visit my site." -- cgit v1.2.3 From 4f4693c142d75d764662f6e501fea5b96c7995a6 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 4 May 2021 21:59:26 +0100 Subject: add camel ascii art --- content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi | 23 ++++++++++++++++++++++ content/html/gemfeed/2008-06-26-perl-poetry.html | 22 +++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi index ea936b91..15b25861 100644 --- a/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi +++ b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi @@ -4,6 +4,29 @@ # Perl Poetry +``` + '\|/' * +-- * ----- + /|\ ____ + ' | ' {_ o^> * + : -_ /) + : ( ( .-''`'. + . \ \ / \ + . \ \ / \ + \ `-' `'. + \ . ' / `. + \ ( \ ) ( .') + ,, t '. | / | ( + '|``_/^\___ '| |`'-..-'| ( () +_~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ + -_ |L[|]L|/ | |\ MJP ) ) + ( |( / /| + ~~ ~ ~ ~~~~ | /\\ / /| | + || \\ _/ / | | + ~ ~ ~~~ _|| (_/ (___)_| |Nov291999 + (__) (____) +``` + Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax. Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks." diff --git a/content/html/gemfeed/2008-06-26-perl-poetry.html b/content/html/gemfeed/2008-06-26-perl-poetry.html index 45658370..c088b7ae 100644 --- a/content/html/gemfeed/2008-06-26-perl-poetry.html +++ b/content/html/gemfeed/2008-06-26-perl-poetry.html @@ -21,6 +21,28 @@ li { color: #98be65; }
Written by Paul Buetow 2008-06-26
Go back to the main site

Perl Poetry

+
+ '\|/'                                  *
+-- * -----
+  /|\      ____
+ ' | '    {_   o^>       *
+   :        -_  /)
+   :         (   (        .-''`'.
+   .          \   \      /       \
+   .           \    \   /         \
+                \    `-'           `'.
+                 \    . '        /    `.
+                  \  ( \  )     (     .')
+   ,,   t          '. |  /       |     (
+  '|``_/^\___        '|  |`'-..-'|   ( ()
+_~~|~/_|_|__/|~~~~~~~ |  / ~~~~~ |   | ~~~~~~~~
+ -_  |L[|]L|/         | |\ MJP   )   )
+                      ( |(       /  /|
+   ~~ ~  ~ ~~~~       | /\\     / /| |
+                      ||  \\  _/ / | |
+             ~ ~ ~~~ _|| (_/ (___)_| |Nov291999
+                    (__)         (____)
+

Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax.

Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."

https://en.wikipedia.org/wiki/Perl
-- cgit v1.2.3 From dce9ea45cd7c6930b6caf6d981626a692831249a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 4 May 2021 22:18:55 +0100 Subject: typos --- content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi | 2 +- content/html/gemfeed/2008-06-26-perl-poetry.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi index 15b25861..96578921 100644 --- a/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi +++ b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi @@ -27,7 +27,7 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ (__) (____) ``` -Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax. +Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax. Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks." diff --git a/content/html/gemfeed/2008-06-26-perl-poetry.html b/content/html/gemfeed/2008-06-26-perl-poetry.html index c088b7ae..fff502de 100644 --- a/content/html/gemfeed/2008-06-26-perl-poetry.html +++ b/content/html/gemfeed/2008-06-26-perl-poetry.html @@ -43,7 +43,7 @@ _~~|~/_|_|__/|~~~~~~~ | / ~~~~~ | | ~~~~~~~~ ~ ~ ~~~ _|| (_/ (___)_| |Nov291999 (__) (____) -

Here are some Perl Poems I wrote. They don't do anything useful when you run them but they don't produce a compiler error either. They only exists for fun and demonstrate what you can do with Perl syntax.

+

Here are some Perl Poems I wrote. They don't do anything useful when you run them, but they don't produce a compiler error either. They only exist for fun and demonstrate what you can do with Perl syntax.

Wikipedia: "Perl poetry is the practice of writing poems that can be compiled as legal Perl code, for example the piece known as Black Perl. Perl poetry is made possible by the large number of English words that are used in the Perl language. New poems are regularly submitted to the community at PerlMonks."

https://en.wikipedia.org/wiki/Perl

math.pl

-- cgit v1.2.3 From 721f56d3cc981e3424a595bcb78d231ce5f4bdb3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 5 May 2021 09:33:09 +0100 Subject: Add "The Fype Programming Language" --- content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi | 2 +- .../2010-05-09-the-fype-programming-language.gmi | 467 +++++++++++++++++++++ content/gemtext/gemfeed/atom.xml | 13 +- content/gemtext/index.gmi | 1 + content/html/gemfeed/2008-06-26-perl-poetry.html | 2 +- .../2010-05-09-the-fype-programming-language.html | 387 +++++++++++++++++ content/html/gemfeed/atom.xml | 13 +- content/html/index.html | 1 + .../2010-05-09-the-fype-programming-language.meta | 5 + 9 files changed, 887 insertions(+), 4 deletions(-) create mode 100644 content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi create mode 100644 content/html/gemfeed/2010-05-09-the-fype-programming-language.html create mode 100644 content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta diff --git a/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi index 96578921..1ba53967 100644 --- a/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi +++ b/content/gemtext/gemfeed/2008-06-26-perl-poetry.gmi @@ -1,4 +1,4 @@ -> Written by Paul Buetow 2008-06-26 +> Written by Paul Buetow 2008-06-26, last updated 2021-05-04 => ../ Go back to the main site diff --git a/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi b/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi new file mode 100644 index 00000000..064a08ce --- /dev/null +++ b/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi @@ -0,0 +1,467 @@ +> Written by Paul Buetow 2010-05-09, last updated 2021-05-05 + +=> ../ Go back to the main site + +``` + ____ _ __ + / / _|_ _ _ __ ___ _ _ ___ __ _| |__ / _|_ _ + / / |_| | | | '_ \ / _ \ | | | |/ _ \/ _` | '_ \ | |_| | | | + _ / /| _| |_| | |_) | __/ | |_| | __/ (_| | | | |_| _| |_| | +(_)_/ |_| \__, | .__/ \___| \__, |\___|\__,_|_| |_(_)_| \__, | + |___/|_| |___/ |___/ + +``` + +# The Fype Programming Language + +Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful. + +The Fype syntax is very simple and is using a maximum look ahead of 1 and a very easy top down parsing mechanism. Fype is parsing and interpreting its code simultaneously. This means, that syntax errors are only detected during program runtime. + +Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say "It's not a hype - it's Fype!". + +## Object oriented C style + +The Fype interpreter is written in an object oriented style of C. Each "main component" has its own .h and .c file. There is a struct type for each (most components at least) component which can be initialized using a "COMPONENT_new" function and destroyed using a "COMPONENT_delete" function. Method calls follow the same schema, e.g. "COMPONENT_METHODNAME". There is no such as class inheritance and polymorphism involved. + +To give you an idea how it works here as an example is a snippet from the main Fype "class": + +``` +typedef struct { + Tupel *p_tupel_argv; // Contains command line options + List *p_list_token; // Initial list of token + Hash *p_hash_syms; // Symbol table + char *c_basename; +} Fype; +``` + +``` +Fype* +fype_new() { + Fype *p_fype = malloc(sizeof(Fype)); + + p_fype->p_hash_syms = hash_new(512); + p_fype->p_list_token = list_new(); + p_fype->p_tupel_argv = tupel_new(); + p_fype->c_basename = NULL; + + garbage_init(); + + return (p_fype); +} + +void +fype_delete(Fype *p_fype) { + argv_tupel_delete(p_fype->p_tupel_argv); + + hash_iterate(p_fype->p_hash_syms, symbol_cleanup_hash_syms_cb); + hash_delete(p_fype->p_hash_syms); + + list_iterate(p_fype->p_list_token, token_ref_down_cb); + list_delete(p_fype->p_list_token); + + if (p_fype->c_basename) + free(p_fype->c_basename); + + garbage_destroy(); +} + +int +fype_run(int i_argc, char **pc_argv) { + Fype *p_fype = fype_new(); + + // argv: Maintains command line options + argv_run(p_fype, i_argc, pc_argv); + + // scanner: Creates a list of token + scanner_run(p_fype); + + // interpret: Interpret the list of token + interpret_run(p_fype); + + fype_delete(p_fype); + + return (0); +} +``` + +## Data types + +Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the following basic data types: +* integer - Specifies a number +* double - Specifies a double precision number +* string - Specifies a string +* number - May be an integer or a double number +* any- May be any type above +* void - No type +* identifier - It's a variable name or a procedure name or a function name + +There is no boolean type, but we can use the integer values 0 for false and 1 for true. There is support for explicit type casting too. + +## Syntax + +### Comments + +Text from a # character until the end of the current line is considered being a comment. Multi line comments may start with an #* and with a *# anywhere. Exceptions are if those signs are inside of strings. + +### Variables + +Variables can be defined with the "my" keyword (inspired by Perl :-). If you don't assign a value during declaration, then it's using the default integer value 0. Variables may be changed during program runtime. Variables may be deleted using the "undef" keyword! Example: + +``` +my foo = 1 + 2; +say foo; + +my bar = 12, baz = foo; +say 1 + bar; +say bar; + +my baz; +say baz; # Will print out 0 +``` + +You may use the "defined" keyword to check if an identifier has been defined or not: + +``` +ifnot defined foo { + say "No foo yet defined"; +} + +my foo = 1; + +if defined foo { + put "foo is defined and has the value "; + say foo; +} +``` + +### Synonyms + +Each variable can have as many synonyms as wished. A synonym is another name to access the content of a specific variable. Here is an example of how to use is: + +``` +my foo = "foo"; +my bar = \foo; +foo = "bar"; + +# The synonym variable should now also set to "bar" +assert "bar" == bar; +``` + +Synonyms can be used for all kind of identifiers. It's not limited to normal variables but can be also used for function and procedure names etc (more about functions and procedures later). + +``` +# Create a new procedure baz +proc baz { say "I am baz"; } + +# Make a synonym baz, and undefine baz +my bay = \baz; + +undef baz; + +# bay still has a reference of the original procedure baz +bay; # this prints aut "I am baz" +``` + +The "syms" keyword gives you the total number of synonyms pointing to a specific value: + +``` +my foo = 1; +say syms foo; # Prints 1 + +my baz = \foo; +say syms foo; # Prints 2 +say syms baz; # Prints 2 + +undef baz; +say syms foo; # Prints 1 +``` + +## Statements and expressions + +A Fype program is a list of statements. Each keyword, expression or function call is part of a statement. Each statement is ended with a semicolon. Example: + +``` +my bar = 3, foo = 1 + 2; +say foo; +exit foo - bar; +``` + +### Parenthesis + +All parenthesis for function arguments are optional. They help to make the code better readable. They also help to force precedence of expressions. + +### Basic expressions + +Any "any" value holding a string will be automatically converted to an integer value. + +``` +(any) + +(any) - +(any) * +(any) / +(integer) == +(integer) != +(integer) <= +(integer) gt +(integer) <> +(integer) gt +(integer) not +``` + +### Bitwise expressions + +``` +(integer) :< +(integer) :> +(integer) and +(integer) or +(integer) xor +``` + +### Numeric expressions + +``` +(number) neg +``` + +... returns the negative value of "number": + + +``` +(integer) no +``` + +... returns 1 if the argument is 0, otherwise it will return 0! If no argument is given, then 0 is returned! + +``` +(integer) yes +``` + +... always returns 1. The parameter is optional. Example: + +``` +# Prints out 1, because foo is not defined +if yes { say no defined foo; } +``` + +## Control statements + +Control statements available in Fype: + +``` +if { } +``` + +... runs the statements if the expression evaluates to a true value. + +``` +ifnot { } +``` + +... runs the statements if the expression evaluates to a false value. + +``` +while { } +``` + +... runs the statements as long as the expression evaluates to a true value. + +``` +until { } +``` + +... runs the statements as long as the expression evaluates to a false value. + +## Scopes + +A new scope starts with an { and ends with an }. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopes. The "scope" function prints out all available symbols at the current scope. Here is a small example: + +``` +my foo = 1; + +{ + # Prints out 1 + put defined foo; + { + my bar = 2; + + # Prints out 1 + put defined bar; + + # Prints out all available symbols at this + # point to stdout. Those are: bar and foo + scope; + } + + # Prints out 0 + put defined bar; + + my baz = 3; +} + +# Prints out 0 +say defined bar; +``` + +## Definedness + +``` +(integer) defined +``` + +... returns 1 if "identifier" has been defined. Returns 0 otherwise. + +``` +(integer) undef +``` + +... tries to undefine/delete the "identifier". Returns 1 if it succeeded, otherwise 0 is returned. + +## System + +These are some system and interpreter specific built-in functions supported: + +``` +(void) end +``` + +... exits the program with the exit status of 0. + +``` +(void) exit +``` + +... exits the program with the specified exit status. + +``` +(integer) fork +``` + +... forks a subprocess. It returns 0 for the child process and the pid of the child process otherwise! Example: + +``` +my pid = fork; + +if pid { + put "I am the parent process; child has the pid "; + say pid; + +} ifnot pid { + say "I am the child process"; +} +``` + +To execute the garbage collector do: + +``` +(integer) gc +``` + +It returns the number of items freed! You may wonder why most of the time it will return a value of 0! Fype tries to free not needed memory ASAP. This may change in future versions in order to gain faster execution speed! + +### I/O + +``` +(any) put +``` + +... prints out the argument + +``` +(any) say +``` + +is the same as put, but also includes an ending newline. + +``` +(void) ln +``` + +... just prints a newline. + +## Procedures and functions + +### Procedures + +A procedure can be defined with the "proc" keyword and deleted with the "undef" keyword. A procedure does not return any value and does not support parameter passing. It's using already defined variables (e.g. global variables). A procedure does not have its own namespace. It's using the calling namespace. It is possible to define new variables inside of a procedure in the current namespace. + +``` +proc foo { + say 1 + a * 3 + b; + my c = 6; +} + +my a = 2, b = 4; + +foo; # Run the procedure. Print out "11\n" +say c; # Print out "6\n"; +``` + +### Nested procedures + +It's possible to define procedures inside of procedures. Since procedures don't have its own scope, nested procedures will be available to the current scope as soon as the main procedure has run the first time. You may use the "defined" keyword in order to check if a procedure has been defined or not. + +``` +proc foo { + say "I am foo"; + + undef bar; + proc bar { + say "I am bar"; + } +} + +# Here bar would produce an error because +# the proc is not yet defined! +# bar; + +foo; # Here the procedure foo will define the procedure bar! +bar; # Now the procedure bar is defined! +foo; # Here the procedure foo will redefine bar again! +``` + +### Functions + +A function can be defined with the "func" keyword and deleted with the "undef" keyword. Function do not yet return values and do not yet supports parameter passing. It's using local (lexical scoped) variables. If a certain variable does not exist, when It's using already defined variables (e.g. one scope above). + +``` +func foo { + say 1 + a * 3 + b; + my c = 6; +} + +my a = 2, b = 4; + +foo; # Run the procedure. Print out "11\n" +say c; # Will produce an error, because c is out of scoped! +``` + +### Nested functions + +Nested functions work the same way the nested procedures work, with the exception that nested functions will not be available anymore after the function has been left! + +``` +func foo { + func bar { + say "Hello i am nested"; + } + + bar; # Calling nested +} + +foo; +bar; # Will produce an error, because bar is out of scope! +``` + +## Fancy stuff + +Fancy stuff like OOP or Unicode or threading is not planed. But fancy stuff like function pointers and closures may be considered.:) + +## May the source be with you + +You can find all of this on the GitHub page. There is also an "examples" folders containing some Fype scripts! + +=> https://github.com/snonux/fype + +E-Mail me your thoughts at comments@mx.buetow.org! diff --git a/content/gemtext/gemfeed/atom.xml b/content/gemtext/gemfeed/atom.xml index de608389..57a2d485 100644 --- a/content/gemtext/gemfeed/atom.xml +++ b/content/gemtext/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2021-05-04T21:44:21+01:00 + 2021-05-05T09:27:32+01:00 buetow.org feed Having fun with computers! @@ -72,6 +72,17 @@ comments@mx.buetow.org + + The Fype Programming Language + + gemini://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.gmi + 2010-05-09T09:26:28+01:00 + Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.. .....to read on please visit my site. + + Paul Buetow + comments@mx.buetow.org + + Perl Poetry diff --git a/content/gemtext/index.gmi b/content/gemtext/index.gmi index 0d69bd80..1e4aadba 100644 --- a/content/gemtext/index.gmi +++ b/content/gemtext/index.gmi @@ -57,4 +57,5 @@ I have switched blog software multiple times. I might be back filling some of th => ./gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi 2016-05-22 Spinning up my own authoritative DNS servers => ./gemfeed/2016-04-16-offsite-backup-with-zfs-part2.gmi 2016-04-16 Offsite backup with ZFS (Part 2) => ./gemfeed/2016-04-03-offsite-backup-with-zfs.gmi 2016-04-03 Offsite backup with ZFS +=> ./gemfeed/2010-05-09-the-fype-programming-language.gmi 2020-05-09 The Fype Programming Language => ./gemfeed/2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry diff --git a/content/html/gemfeed/2008-06-26-perl-poetry.html b/content/html/gemfeed/2008-06-26-perl-poetry.html index fff502de..758732b3 100644 --- a/content/html/gemfeed/2008-06-26-perl-poetry.html +++ b/content/html/gemfeed/2008-06-26-perl-poetry.html @@ -18,7 +18,7 @@ li { color: #98be65; } -
Written by Paul Buetow 2008-06-26
+
Written by Paul Buetow 2008-06-26, last updated 2021-05-04
Go back to the main site

Perl Poetry

diff --git a/content/html/gemfeed/2010-05-09-the-fype-programming-language.html b/content/html/gemfeed/2010-05-09-the-fype-programming-language.html
new file mode 100644
index 00000000..41bfc0e7
--- /dev/null
+++ b/content/html/gemfeed/2010-05-09-the-fype-programming-language.html
@@ -0,0 +1,387 @@
+
+
+
+Having fun with computers!
+
+
+
+
+
+
Written by Paul Buetow 2010-05-09, last updated 2021-05-05
+Go back to the main site
+
+      ____                                      _        __       
+     / / _|_   _ _ __   ___    _   _  ___  __ _| |__    / _|_   _ 
+    / / |_| | | | '_ \ / _ \  | | | |/ _ \/ _` | '_ \  | |_| | | |
+ _ / /|  _| |_| | |_) |  __/  | |_| |  __/ (_| | | | |_|  _| |_| |
+(_)_/ |_|  \__, | .__/ \___|   \__, |\___|\__,_|_| |_(_)_|  \__, |
+           |___/|_|            |___/                        |___/ 
+
+
+

The Fype Programming Language

+

Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.

+

The Fype syntax is very simple and is using a maximum look ahead of 1 and a very easy top down parsing mechanism. Fype is parsing and interpreting its code simultaneously. This means, that syntax errors are only detected during program runtime.

+

Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say "It's not a hype - it's Fype!".

+

Object oriented C style

+

The Fype interpreter is written in an object oriented style of C. Each "main component" has its own .h and .c file. There is a struct type for each (most components at least) component which can be initialized using a "COMPONENT_new" function and destroyed using a "COMPONENT_delete" function. Method calls follow the same schema, e.g. "COMPONENT_METHODNAME". There is no such as class inheritance and polymorphism involved.

+

To give you an idea how it works here as an example is a snippet from the main Fype "class":

+
+typedef struct {
+   Tupel *p_tupel_argv; // Contains command line options
+   List *p_list_token; // Initial list of token
+   Hash *p_hash_syms; // Symbol table
+   char *c_basename;
+} Fype;
+
+
+Fype*
+fype_new() {
+   Fype *p_fype = malloc(sizeof(Fype));
+
+   p_fype->p_hash_syms = hash_new(512);
+   p_fype->p_list_token = list_new();
+   p_fype->p_tupel_argv = tupel_new();
+   p_fype->c_basename = NULL;
+
+   garbage_init();
+
+   return (p_fype);
+}
+
+void
+fype_delete(Fype *p_fype) {
+   argv_tupel_delete(p_fype->p_tupel_argv);
+
+   hash_iterate(p_fype->p_hash_syms, symbol_cleanup_hash_syms_cb);
+   hash_delete(p_fype->p_hash_syms);
+
+   list_iterate(p_fype->p_list_token, token_ref_down_cb);
+   list_delete(p_fype->p_list_token);
+
+   if (p_fype->c_basename)
+      free(p_fype->c_basename);
+
+   garbage_destroy();
+}
+
+int
+fype_run(int i_argc, char **pc_argv) {
+   Fype *p_fype = fype_new();
+
+   // argv: Maintains command line options
+   argv_run(p_fype, i_argc, pc_argv);
+
+   // scanner: Creates a list of token
+   scanner_run(p_fype);
+
+   // interpret: Interpret the list of token
+   interpret_run(p_fype);
+
+   fype_delete(p_fype);
+
+   return (0);
+}
+
+

Data types

+

Fype uses auto type conversion. However, if you want to know what's going on you may take a look at the following basic data types:

+
    +
  • integer - Specifies a number
  • +
  • double - Specifies a double precision number
  • +
  • string - Specifies a string
  • +
  • number - May be an integer or a double number
  • +
  • any- May be any type above
  • +
  • void - No type
  • +
  • identifier - It's a variable name or a procedure name or a function name
  • +
+

There is no boolean type, but we can use the integer values 0 for false and 1 for true. There is support for explicit type casting too.

+

Syntax

+

Comments

+

Text from a # character until the end of the current line is considered being a comment. Multi line comments may start with an #* and with a *# anywhere. Exceptions are if those signs are inside of strings.

+

Variables

+

Variables can be defined with the "my" keyword (inspired by Perl :-). If you don't assign a value during declaration, then it's using the default integer value 0. Variables may be changed during program runtime. Variables may be deleted using the "undef" keyword! Example:

+
+my foo = 1 + 2;
+say foo; 
+
+my bar = 12, baz = foo;
+say 1 + bar;
+say bar;
+
+my baz;
+say baz; # Will print out 0
+
+

You may use the "defined" keyword to check if an identifier has been defined or not:

+
+ifnot defined foo {
+	say "No foo yet defined";
+}
+
+my foo = 1;
+
+if defined foo {
+	put "foo is defined and has the value ";
+	say foo;
+}
+
+

Synonyms

+

Each variable can have as many synonyms as wished. A synonym is another name to access the content of a specific variable. Here is an example of how to use is:

+
+my foo = "foo";
+my bar = \foo;
+foo = "bar";
+
+# The synonym variable should now also set to "bar"
+assert "bar" == bar;
+
+

Synonyms can be used for all kind of identifiers. It's not limited to normal variables but can be also used for function and procedure names etc (more about functions and procedures later).

+
+# Create a new procedure baz
+proc baz { say "I am baz"; }
+
+# Make a synonym baz, and undefine baz
+my bay = \baz;
+
+undef baz;
+
+# bay still has a reference of the original procedure baz
+bay; # this prints aut "I am baz" 
+
+

The "syms" keyword gives you the total number of synonyms pointing to a specific value:

+
+my foo = 1;
+say syms foo; # Prints 1
+
+my baz = \foo; 
+say syms foo; # Prints 2
+say syms baz; # Prints 2
+
+undef baz;
+say syms foo; # Prints 1
+
+

Statements and expressions

+

A Fype program is a list of statements. Each keyword, expression or function call is part of a statement. Each statement is ended with a semicolon. Example:

+
+my bar = 3, foo = 1 + 2; 
+say foo;
+exit foo - bar;
+
+

Parenthesis

+

All parenthesis for function arguments are optional. They help to make the code better readable. They also help to force precedence of expressions.

+

Basic expressions

+

Any "any" value holding a string will be automatically converted to an integer value.

+
+(any) <any> + <any>
+(any) <any> - <any>
+(any) <any> * <any>
+(any) <any> / <any>
+(integer) <any> == <any>
+(integer) <any> != <any>
+(integer) <any> <= <any>
+(integer) <any> gt <any>
+(integer) <any> <> <any>
+(integer) <any> gt <any>
+(integer) not <any>
+
+

Bitwise expressions

+
+(integer) <any> :< <any>
+(integer) <any> :> <any>
+(integer) <any> and <any>
+(integer) <any> or <any>
+(integer) <any> xor <any>
+
+

Numeric expressions

+
+(number) neg <number>
+
+

... returns the negative value of "number":

+
+(integer) no <integer>
+
+

... returns 1 if the argument is 0, otherwise it will return 0! If no argument is given, then 0 is returned!

+
+(integer) yes <integer>
+
+

... always returns 1. The parameter is optional. Example:

+
+# Prints out 1, because foo is not defined
+if yes { say no defined foo; } 
+
+

Control statements

+

Control statements available in Fype:

+
+if <expression> { <statements> }
+
+

... runs the statements if the expression evaluates to a true value.

+
+ifnot <expression> { <statements> }
+
+

... runs the statements if the expression evaluates to a false value.

+
+while <expression> { <statements> }
+
+

... runs the statements as long as the expression evaluates to a true value.

+
+until <expression> { <statements> }
+
+

... runs the statements as long as the expression evaluates to a false value.

+

Scopes

+

A new scope starts with an { and ends with an }. An exception is a procedure, which does not use its own scope (see later in this manual). Control statements and functions support scopes. The "scope" function prints out all available symbols at the current scope. Here is a small example:

+
+my foo = 1;
+
+{
+	# Prints out 1
+	put defined foo;
+	{
+		my bar = 2;
+
+		# Prints out 1
+		put defined bar;
+
+		# Prints out all available symbols at this
+		# point to stdout. Those are: bar and foo
+		scope;
+	}
+
+	# Prints out 0
+	put defined bar;
+
+	my baz = 3;
+}
+
+# Prints out 0
+say defined bar;
+
+

Definedness

+
+(integer) defined <identifier>
+
+

... returns 1 if "identifier" has been defined. Returns 0 otherwise.

+
+(integer) undef <identifier>
+
+

... tries to undefine/delete the "identifier". Returns 1 if it succeeded, otherwise 0 is returned.

+

System

+

These are some system and interpreter specific built-in functions supported:

+
+(void) end
+
+

... exits the program with the exit status of 0.

+
+(void) exit <integer>
+
+

... exits the program with the specified exit status.

+
+(integer) fork
+
+

... forks a subprocess. It returns 0 for the child process and the pid of the child process otherwise! Example:

+
+my pid = fork;
+
+if pid {
+	put "I am the parent process; child has the pid ";
+	say pid;
+
+} ifnot pid {
+	say "I am the child process";
+}
+
+

To execute the garbage collector do:

+
+(integer) gc
+
+

It returns the number of items freed! You may wonder why most of the time it will return a value of 0! Fype tries to free not needed memory ASAP. This may change in future versions in order to gain faster execution speed!

+

I/O

+
+(any) put <any>
+
+

... prints out the argument

+
+(any) say <any>
+
+

is the same as put, but also includes an ending newline.

+
+(void) ln
+
+

... just prints a newline.

+

Procedures and functions

+

Procedures

+

A procedure can be defined with the "proc" keyword and deleted with the "undef" keyword. A procedure does not return any value and does not support parameter passing. It's using already defined variables (e.g. global variables). A procedure does not have its own namespace. It's using the calling namespace. It is possible to define new variables inside of a procedure in the current namespace.

+
+proc foo {
+	say 1 + a * 3 + b;
+	my c = 6;
+}
+
+my a = 2, b = 4;
+
+foo; # Run the procedure. Print out "11\n"
+say c; # Print out "6\n";
+
+

Nested procedures

+

It's possible to define procedures inside of procedures. Since procedures don't have its own scope, nested procedures will be available to the current scope as soon as the main procedure has run the first time. You may use the "defined" keyword in order to check if a procedure has been defined or not.

+
+proc foo {
+	say "I am foo";
+
+	undef bar;
+	proc bar {
+		say "I am bar";
+	}
+}
+
+# Here bar would produce an error because 
+# the proc is not yet defined!
+# bar; 
+
+foo; # Here the procedure foo will define the procedure bar!
+bar; # Now the procedure bar is defined!
+foo; # Here the procedure foo will redefine bar again!
+
+

Functions

+

A function can be defined with the "func" keyword and deleted with the "undef" keyword. Function do not yet return values and do not yet supports parameter passing. It's using local (lexical scoped) variables. If a certain variable does not exist, when It's using already defined variables (e.g. one scope above).

+
+func foo {
+	say 1 + a * 3 + b;
+	my c = 6;
+}
+
+my a = 2, b = 4;
+
+foo; # Run the procedure. Print out "11\n"
+say c; # Will produce an error, because c is out of scoped!
+
+

Nested functions

+

Nested functions work the same way the nested procedures work, with the exception that nested functions will not be available anymore after the function has been left!

+
+func foo {
+	func bar {
+		say "Hello i am nested";
+	}
+
+	bar; # Calling nested
+}
+
+foo;
+bar; # Will produce an error, because bar is out of scope!
+
+

Fancy stuff

+

Fancy stuff like OOP or Unicode or threading is not planed. But fancy stuff like function pointers and closures may be considered.:)

+

May the source be with you

+

You can find all of this on the GitHub page. There is also an "examples" folders containing some Fype scripts!

+https://github.com/snonux/fype
+

E-Mail me your thoughts at comments@mx.buetow.org!

+ + diff --git a/content/html/gemfeed/atom.xml b/content/html/gemfeed/atom.xml index d3643b93..ff147c01 100644 --- a/content/html/gemfeed/atom.xml +++ b/content/html/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2021-05-04T21:44:21+01:00 + 2021-05-05T09:27:32+01:00 buetow.org feed Having fun with computers! @@ -72,6 +72,17 @@ comments@mx.buetow.org + + The Fype Programming Language + + https://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.html + 2010-05-09T09:26:28+01:00 + Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.. .....to read on please visit my site. + + Paul Buetow + comments@mx.buetow.org + + Perl Poetry diff --git a/content/html/index.html b/content/html/index.html index 2f6129af..1c3cdf0b 100644 --- a/content/html/index.html +++ b/content/html/index.html @@ -61,6 +61,7 @@ li { color: #98be65; } 2016-05-22 Spinning up my own authoritative DNS servers
2016-04-16 Offsite backup with ZFS (Part 2)
2016-04-03 Offsite backup with ZFS
+2020-05-09 The Fype Programming Language
2008-06-26 Perl Poetry
diff --git a/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta b/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta new file mode 100644 index 00000000..77c4a44d --- /dev/null +++ b/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta @@ -0,0 +1,5 @@ +local meta_date="2010-05-09T09:26:28+01:00" +local meta_author="Paul Buetow" +local meta_email="comments@mx.buetow.org" +local meta_title="The Fype Programming Language" +local meta_summary="Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.. .....to read on please visit my site." -- cgit v1.2.3 From abf8a0771b912c5e19368a913827932bc3bd9a21 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 5 May 2021 09:38:11 +0100 Subject: separate header from impl. --- content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi | 4 +++- content/html/gemfeed/2010-05-09-the-fype-programming-language.html | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi b/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi index 064a08ce..ac7c3790 100644 --- a/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi +++ b/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi @@ -24,7 +24,7 @@ Fype is a recursive acronym and means "Fype is For Your Program Execution" or "F The Fype interpreter is written in an object oriented style of C. Each "main component" has its own .h and .c file. There is a struct type for each (most components at least) component which can be initialized using a "COMPONENT_new" function and destroyed using a "COMPONENT_delete" function. Method calls follow the same schema, e.g. "COMPONENT_METHODNAME". There is no such as class inheritance and polymorphism involved. -To give you an idea how it works here as an example is a snippet from the main Fype "class": +To give you an idea how it works here as an example is a snippet from the main Fype "class header": ``` typedef struct { @@ -35,6 +35,8 @@ typedef struct { } Fype; ``` +And here is a snippet from the main Fype "class implementation": + ``` Fype* fype_new() { diff --git a/content/html/gemfeed/2010-05-09-the-fype-programming-language.html b/content/html/gemfeed/2010-05-09-the-fype-programming-language.html index 41bfc0e7..40beea42 100644 --- a/content/html/gemfeed/2010-05-09-the-fype-programming-language.html +++ b/content/html/gemfeed/2010-05-09-the-fype-programming-language.html @@ -35,7 +35,7 @@ li { color: #98be65; }

Fype is a recursive acronym and means "Fype is For Your Program Execution" or "Fype is Free Yak Programmed for ELF". You could also say "It's not a hype - it's Fype!".

Object oriented C style

The Fype interpreter is written in an object oriented style of C. Each "main component" has its own .h and .c file. There is a struct type for each (most components at least) component which can be initialized using a "COMPONENT_new" function and destroyed using a "COMPONENT_delete" function. Method calls follow the same schema, e.g. "COMPONENT_METHODNAME". There is no such as class inheritance and polymorphism involved.

-

To give you an idea how it works here as an example is a snippet from the main Fype "class":

+

To give you an idea how it works here as an example is a snippet from the main Fype "class header":

 typedef struct {
    Tupel *p_tupel_argv; // Contains command line options
@@ -44,6 +44,7 @@ typedef struct {
    char *c_basename;
 } Fype;
 
+

And here is a snippet from the main Fype "class implementation":

 Fype*
 fype_new() {
-- 
cgit v1.2.3


From 9ae383ee25faf1256e4c5386715634a543d4a314 Mon Sep 17 00:00:00 2001
From: Paul Buetow 
Date: Wed, 5 May 2021 09:40:27 +0100
Subject: fix date in index

---
 content/gemtext/index.gmi | 2 +-
 content/html/index.html   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/content/gemtext/index.gmi b/content/gemtext/index.gmi
index 1e4aadba..b52a970d 100644
--- a/content/gemtext/index.gmi
+++ b/content/gemtext/index.gmi
@@ -57,5 +57,5 @@ I have switched blog software multiple times. I might be back filling some of th
 => ./gemfeed/2016-05-22-spinning-up-my-own-authoritative-dns-servers.gmi 2016-05-22 Spinning up my own authoritative DNS servers
 => ./gemfeed/2016-04-16-offsite-backup-with-zfs-part2.gmi 2016-04-16 Offsite backup with ZFS (Part 2)
 => ./gemfeed/2016-04-03-offsite-backup-with-zfs.gmi 2016-04-03 Offsite backup with ZFS
-=> ./gemfeed/2010-05-09-the-fype-programming-language.gmi 2020-05-09 The Fype Programming Language
+=> ./gemfeed/2010-05-09-the-fype-programming-language.gmi 2010-05-09 The Fype Programming Language
 => ./gemfeed/2008-06-26-perl-poetry.gmi 2008-06-26 Perl Poetry
diff --git a/content/html/index.html b/content/html/index.html
index 1c3cdf0b..8e9c7e5d 100644
--- a/content/html/index.html
+++ b/content/html/index.html
@@ -61,7 +61,7 @@ li { color: #98be65; }
 2016-05-22 Spinning up my own authoritative DNS servers
2016-04-16 Offsite backup with ZFS (Part 2)
2016-04-03 Offsite backup with ZFS
-2020-05-09 The Fype Programming Language
+2010-05-09 The Fype Programming Language
2008-06-26 Perl Poetry
-- cgit v1.2.3 From b31d49a9e3e6e8d561731d5e9ff1cd4780e2c0cb Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 5 May 2021 09:41:50 +0100 Subject: being expert is relative --- content/gemtext/resources.gmi | 2 +- content/html/resources.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/gemtext/resources.gmi b/content/gemtext/resources.gmi index dd145fa0..a6aadd84 100644 --- a/content/gemtext/resources.gmi +++ b/content/gemtext/resources.gmi @@ -2,7 +2,7 @@ # Resources -This is a list of resources I found useful. I am not an expert in all (but some) of these topics but all the resources listed here made an impact on me. I've read some of the books quite a long time ago, so there might be newer editions out there already and I might need to refresh some of the knowledge. +This is a list of resources I found useful. I am not an expert in all of these topics but all the resources listed here made an impact on me. I've read some of the books quite a long time ago, so there might be newer editions out there already and I might need to refresh some of the knowledge. The list may not be exhaustive but I will be adding more in the future. I strongly believe that educating yourself further is one of the most important things you should do in order to advance. The lists are in random order and reshuffled every time (via *sort -R*) when updates are made. diff --git a/content/html/resources.html b/content/html/resources.html index eece15cc..a0e939be 100644 --- a/content/html/resources.html +++ b/content/html/resources.html @@ -20,7 +20,7 @@ li { color: #98be65; } Go back to the main site

Resources

-

This is a list of resources I found useful. I am not an expert in all (but some) of these topics but all the resources listed here made an impact on me. I've read some of the books quite a long time ago, so there might be newer editions out there already and I might need to refresh some of the knowledge.

+

This is a list of resources I found useful. I am not an expert in all of these topics but all the resources listed here made an impact on me. I've read some of the books quite a long time ago, so there might be newer editions out there already and I might need to refresh some of the knowledge.

The list may not be exhaustive but I will be adding more in the future. I strongly believe that educating yourself further is one of the most important things you should do in order to advance. The lists are in random order and reshuffled every time (via *sort -R*) when updates are made.

You won't find any links on this site because over time the links will break. Please use your favorite search engine when you are interested in one of the resources...

-- 
cgit v1.2.3


From 86edf888ba6cf1be60facd17d5d07d794ecf0b68 Mon Sep 17 00:00:00 2001
From: Paul Buetow 
Date: Wed, 5 May 2021 09:45:07 +0100
Subject: no plenking

---
 content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi | 1 -
 1 file changed, 1 deletion(-)

diff --git a/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi b/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi
index ac7c3790..74a6c259 100644
--- a/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi
+++ b/content/gemtext/gemfeed/2010-05-09-the-fype-programming-language.gmi
@@ -229,7 +229,6 @@ Any "any" value holding a string will be automatically converted to an integer v
 
 ... returns the negative value of "number":
 
-
 ```
 (integer) no 
 ```
-- 
cgit v1.2.3


From cd60410