Languages

Discussion and questions about programming with Ultibo.
hippy
Posts: 31
Joined: Tue Jan 02, 2018 5:54 pm
Location: UK

Re: Languages

Postby hippy » Fri Apr 19, 2019 2:05 am

pik33 wrote:We should consider 3 languages:

- Pascal. This is the language in which Ultibo was written.
- C. This is "English" in programming languages. A common language for all the world.
- assembler. This is needed where speed or size matters; you can optimize what you want.

We don' need more.

I definitely think Python needs to be added to that list. I would prefer a full Python but MicroPython would be better than nothing and probably easier to do.

A fuller Python would however set it apart from other MicroPython boards, and would also appeal to those who don't have a lot of experience with or desire for Pascal, C or Assembler.
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Fri Apr 19, 2019 6:26 am

C, Rust, Go etc are compiled and would have no issues with talking to an Ultibo API if it used a C like API..
But many simpler, slower things can be done with Interpreted languages too.
Interpreted languages are generally easier to use too.

Ultibo already has lots of stuff that just works so all that a user needs to do is write the application level code.
Could this be done with interpreted code with Ultibo like a VM or Runtime library module?
Probably many ways to do it.

Looks like many have discussed Python/Pascal on the FPC forum.
https://forum.lazarus.freepascal.org/in ... ic=33304.0
https://forum.lazarus.freepascal.org/in ... ic=21537.0

Perhaps one day there will be a bunch of units that can be used, embedded Interpreters in many languages.
Then self hosted compilers?
Perhaps even a self hosted IDE that does many languages?
https://github.com/fredvs/ideU

Is there an interpreter that can interpret more than one language?
Linux Shell script can call other interpreters ;)

I don't like the white space in Python, I do like the cleaner look of D.
But what could be useful later on? Javascript?
That would be handy for embedding in a Ultibo Browser.
Most JS is now runtime compiled, that's why those Browsers are so bloated.

Anyway, no point saying no to anything, it is probably all possible, one day :lol:
For me it's 7 years in Pi Land, just over 2 years for Ultibo, that's a blink in time for the computing World.
Reinventing the wheel is fun if you want to know how to make wheels, it's all learning.
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Sun Apr 21, 2019 8:34 am

Got Sliderule and Steamtrain demo working in Linux.
Interpreted languages are easier :D
And there are lots of exampes, even better clocks.

As I have been playing with tcl/tk examples I came across some history of tcl/tk and found it is used in Python.
https://docs.python.org/3/library/tk.html
I had heard of tkinter, even used it but that was years ago.
Never really paid much attention to it.

Some people would like a full Python in Ultibo but tkinter seems to be required?
Tkinter is implemented as a Python wrapper around a complete Tcl interpreter embedded in the Python interpreter.

https://docs.python.org/3/library/tkint ... ld-program

So understanding tcl/tk will help with Python?
Dependencies :D

Free Pascal's LCL is a compiled library.
The tk basics would also written in Ultibo code, common functions to LCL?
There is even a Themed tk - ttk.
https://en.wikipedia.org/wiki/Tkinter

Other languages like PERL use tcl/tk.

Finally figured out the command line version of LIL in Linux, so time to try it in Ultibo.

My friend Google found me asking about tcl/tk from 4 years go, pre Ultibo ;)
http://forum.tinycorelinux.net/index.php?topic=18947.0
Perhaps tk need an OpenVG version? x11 eek.

Interestingly my requirements are still the same, but Linux has been replaced with Ultibo and simple GUIs are now very close.
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Tue Apr 23, 2019 5:05 am

PL0 a Pascal like Language from before Pascal?
https://github.com/dalegebit/pl0-compiler
https://github.com/oriontransfer/PL0-La ... plzero.pas
https://en.wikipedia.org/wiki/PL/0

Simpler than Pascal?
Wonder if it can be used as an embedded compiler?
I like these small, single file interpreters and compilers.
Apart from the history and simplicity, they also provide insights into Wirth's later stuff.

Time to read those Wirth books.

TinyBasic source in Free Pascal?
https://www.aldweb.com/articles.php?lng=en&pg=7407

Why settle for one language when many can be added to Ultibo.
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Mon May 06, 2019 7:40 am

Been looking for a Python version that may port.
This one is based on a few files.
http://www.tinypy.org/

The "Big" micropython ;)
https://micropython.org/

Interesting interpreter in Go
https://github.com/sbinet/pygo

A little python
https://github.com/derpferd/little-python

Starting to notice a few words in common parser, tokenizer, interpreter....,
By messing about with the tokens could it do Basic, Lua, etc.

Google tokenizers....
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Mon May 06, 2019 8:33 am

Should spend some time here.
https://rosettacode.org/wiki/Tokenize_a_string#Pascal

Pascal tokenizer in Python, port to Pascal using clues form Rosettacode
https://github.com/Artem3213212/PyPascalTokenizer

Going to need to learn the Free Pascal TStringList stuff, it looks useful.

This is kinda compiler that compiles a C type language.
https://www.thedelphigeek.com/2017/08/w ... elphi.html
https://github.com/gabr42/SimpleDSLCompiler
DSL - Delphi Script Language?
Anyway, a simple to understand explanation of how it works with pictures :D
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Thu May 09, 2019 9:03 am

Pascal Virtual AMachine? It is not even ancient ;)
http://symsyn.qsys.us/
hansotten
Posts: 55
Joined: Thu Feb 04, 2016 7:07 am

Re: Languages

Postby hansotten » Thu May 09, 2019 1:01 pm

Gavinmc42 wrote:Pascal Virtual AMachine? It is not even ancient ;)
http://symsyn.qsys.us/


No source available ...
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Fri May 10, 2019 1:44 am

No source available ...

Rats, I should have checked, found it just before going home.

Amazon has a book - Symsyn: A programming language for non programmers - Isaac Stone
No idea who the Symsyn Group is but Isaac Stone shows up as a SiFi author :o
Gavinmc42
Posts: 1586
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Languages

Postby Gavinmc42 » Tue May 21, 2019 12:17 am

Prolog is old but looks like it is common for AI to use it to analyze text.

And there are versions of the old Pascal interpreters written in newer Pascal.
https://spivey.oriel.ox.ac.uk/corner/PicoProlog

http://troydm.github.io/blog/2014/01/26 ... run-again/

A multiparadigm language, an interesting mix of programming methods
http://web.engr.oregonstate.edu/~budd/Books/leda/
https://github.com/Henry/Leda
Leda looks like some sort of C/Pascal syntax mixture.

How many languages are there anyway? 1500 :o I have a lot to learn :lol:
http://www.99-bottles-of-beer.net/

Writing interpreters in Free Pascal with all the new improvements that Object enabled Pascal has over the older Pascals?
I still don't know enough about modern Free Pascal.

Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest