PDA

View Full Version : Considering semantic versioning



Petr Schreiber
28-07-2018, 19:10
Dear Eros, dear community,

I would like to share one concept for software development, which I find easy to follow both for developers and their users.

It could be applied to thinBASIC, it could be applied to thinBASIC modules, it could be applied to applications you develop with thin tools.


Semantic versioning

Semantic versioning is often mentioned as "created by" Tom Preston-Werner. He indeed deserves the credit for keeping all the rules on one place, the system is basically a composition of common sense rules.
It can be read in its whole here: https://semver.org/

The approach gained significance for languages with package system, but I find it highly valuable even for other types of applications.

In a nutshell, version is considered a set of 3 numbers:
MAJOR.MINOR.PATCH

Changing the major should be done only in case you introduce backwards incompatible changes.

Changing the minor should be done in case you add new feature.

Changing the patch should be done in case the new version introduces some fixes.

I also like the "Once a versioned package has been released, the contents of that version MUST NOT be modified. Any modifications MUST be released as a new version."

This also somehow implicates it is good idea to do pure bugfix, pure feature releases, which is a concept I like.


The benefits

The main benefit I see is the clear communication towards user:

- if you are using software / module in version A.0.0, it is guaranteed the use will be the same with any A.*.* version (because A guarantees backwards compatiblity). However, you know you should be alerted once version B.*.* appears and you should not migrate without proper thought

- if you expect certain feature from software / module, specifying version on MAJOR.MINOR level is completely sufficient

- if you see version MAJOR.MINOR.1 and MAJOR.MINOR.2, no reason to think if I should pick first or second, the MAJOR.MINOR.2 should be of more quality (less bugs) than MAJOR.MINOR.1


How could thinBASIC gain from this?

ThinBASIC already offers handy #minVersion statement, which restricts the execution of script by older version of interpreter.

It would be interesting to have something similar for thinBasic modules - very useful for 3rd party development, modules not in the standard distribution.

Such mechanism could prevent mis-use of module with wrong version of core for example.

Being agreed on the semantic versioning approach could also mean we could introduce some further dependency checks and restrictions, which could increase stability of the tools we use and develop.


Petr

ReneMiner
28-07-2018, 21:33
That's cool.

But I fear then there will never be thinbasic 2.0...?

Or can it be that we finally and official completely drop support of 16 Bit-OS to make it a "valid thinbasic 2.0" ??

Petr Schreiber
29-07-2018, 09:49
Hi Rene,

I am not sure I follow here :)

Why do you "fear" there will be no thinBasic 2.x?

What do you mean by support for 16bit OS? I don't think thinBasic could run on Windows 3.1 :)

My proposal is generic and has benefits immediately, even for the 1.x line.


Petr

ReneMiner
29-07-2018, 10:07
Sorry, guess I confused something with Win95/98...
Probably it should mean no more support for
Windows below XP, so 98 and lower. It is already required to have XP SP2 or better since 1.9.something when using TBGL, remember? Also UI already has some features that require XP SP2 I think...

primo
29-07-2018, 14:30
Petr, have you made a conference with Eros about boosting TB core speed ??
i don't want from you to disclose the secret of this boosting, but if you can post a short cryptic gestures we may feel better without disclosing the secret like the full moon..
if this speed boosting happened then it deserve TB v2.0

ErosOlmi
30-07-2018, 14:18
Hi Petr,

I can agree with the method you suggested but not sure it can improve something or clear something.

I mean ...

very rarely I've broken backward compatibility.
Very often I release new features and fixes on the same new release but clearly stated in What's new history what is what.


Anyway, I will better read the reference you mentioned, maybe I missed something.

Regarding module development ... again the main interface is there since the very beginning and instead of break backward compatibility I develop new variants of the same SDK function. Like in COM development rules: once you have released an interface that interface cannot be changed and you have to release a new version.

Yes, I agree that I've done a great mistake releasing for so long time 1.10.xxx beta phases.
I will try to close all open items and document them and then release as stable.

Ciao
Eros

ErosOlmi
30-07-2018, 14:27
Petr, have you made a conference with Eros about boosting TB core speed ??
i don't want from you to disclose the secret of this boosting, but if you can post a short cryptic gestures we may feel better without disclosing the secret like the full moon..
if this speed boosting happened then it deserve TB v2.0

Ciao Primo,

thinBasic speed is something I do not think I will be able to improve as a "general" improvement.
Maybe I will improve some specific function or some specific aspect but the main speed is influenced "negatively" by the interpretative nature of the language.
To boost it I should transform thinBasic into an intermediate pCode generator and then have an executor able to execute intermediate pCode.
But that is not in my head at the moment.

If you need SPEED for example for you great fractal and math script where thousands or millions of loops are the basis ... I'm sorry and reluctant to say that thinBasic ha limits on that.

What I can say is that I'm always on the "more speed the better it is" line when I develop something.
So I will always continue to improve execution speed but never expect "jumps" on that aspect.

Ciao
Eros

ErosOlmi
30-07-2018, 14:37
That's cool.

But I fear then there will never be thinbasic 2.0...?

Or can it be that we finally and official completely drop support of 16 Bit-OS to make it a "valid thinbasic 2.0" ??

Ciao Renč

16 bit are not supported at all.
Even Windows XP ... Core engine is compatible but some of the modules I think not.

Anyway, version 2.x of thinBasic ... is something will completely change thinBasic Core engine.
My idea of version 2.x is related on multi threading and will for sure break backward compatibility because for every internal and external function calling a new parameter (current thread) will be needed so all SDK function will be rewritten.

For modules development it will not change too much but they will need to be rewritten to pass one DWORD parameter that will be passed to all SDK function calling.

Ciao
Eros

Petr Schreiber
30-07-2018, 19:27
Hi Eros,

my apologies for the confusion - I tried to sum it up in the last paragraph, but maybe it made no sense.

You might remember I had a pretty confusing versioning policy for TBGL, where I kept my independent versioning, then I switched to sync with ThinBASIC versioning, but - sense it makes little, as it does not say much about the api compatibility of the module itself.

I did some research and found semver, which I find good to follow and basically what you do all the time with thinBasic.

The point I wanted to make with the post is that:
- it would be nice to have some document, which could be shown to new module / unit developers with the comment "this is the set of rules we follow"
- it would be nice to have mechanism to verify, whether module is compatible with core (possible by following this idea)

The second one would need some tuning in core, not sure how exactly yet. I wanted to open discussion on that topic.

You might remember me thinking out loud about package/dependency management for thinBASIC. Having such a mechanism could make it easier.

My apologies if you understood it as critique/complaint.


Petr

Charles Pegge
31-07-2018, 12:21
Hi Petr,

I like the scheme. We can adopt it for o2, starting soon with the self-compiling betas.
o2_version will also return an ISO timestamp, following the version numbers:

0.1.0 2018-07-31T07:29:00

ErosOlmi
31-07-2018, 13:18
My apologies if you understood it as critique/complaint.


:D I'm laughing because this is a strange situation where you are apologizing with me, when I should have thanked you every day during the last 14 year.
Petr, every idea you had and have is a present from the sky for us in this forum!!!!!

What made me think more about your post is that I did a great mistake in going on with a big beta phase while I should have done little but continuous release of new versions.
So now I will concentrate to fix and document all the new feature present in beta version 1.10.x and release as stable.

Than we will discuss again about this post.