comp.lang.ada
 help / color / mirror / Atom feed
* My first test of github: cpros - lightweight Ada command processor
@ 2017-09-24 15:07 reinert
  2017-09-25  7:20 ` reinert
  2017-09-27 16:16 ` Jacob Sparre Andersen
  0 siblings, 2 replies; 20+ messages in thread
From: reinert @ 2017-09-24 15:07 UTC (permalink / raw)


Hello,

I am preparing to use github for an Ada project. To make the learning curve steeper, I now put a small test project on github:

https://github.com/reinertk/cpros

Yes, things are missing here, but could anybody make some valuable comments to help make the learning faster? Any problem to get access to it?

reinert

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-24 15:07 My first test of github: cpros - lightweight Ada command processor reinert
@ 2017-09-25  7:20 ` reinert
  2017-09-25 13:08   ` AdaMagica
  2017-09-27 16:16 ` Jacob Sparre Andersen
  1 sibling, 1 reply; 20+ messages in thread
From: reinert @ 2017-09-25  7:20 UTC (permalink / raw)


For those interested:

I did update the README file after some comments (+ changed cpros_test1.adb + included the files mac1 and mac1). 

Have now learned the command "git push" :-)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25  7:20 ` reinert
@ 2017-09-25 13:08   ` AdaMagica
  2017-09-25 14:04     ` reinert
                       ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: AdaMagica @ 2017-09-25 13:08 UTC (permalink / raw)


A quote from the README:
"You have to dig into the source code of cpros_test1 to figure out more if you want to use this simple (but for me useful) tool."

Am I the only one who finds this attitude terrible and unbearable for software engineering practices?

So let's peek at the code. There is a file rsplit.ads. Hm, what's R? Split, OK... or is it the slovenian town Split?
There are no comments inside inlightening me about Rsplit.

Inside: White_Space is not really white, but OK, I would perhaps choose the same name.

There is a function Number_of_Words with a parameter FS. FS doesn't tell me anything - just a string.

Function Word, parameter FS, the same as before;
parameter S? Word_Number: Natural.

No idea what this might be...

Now switch on my superman brain: A, FS might mean Full_String and Word returns the word with position Word_Number. So S might mean Word_Separator. Why the hell doesn't the author say so? Ah, no, S is a string. So is any character in S a separator or the full S?

Ah, Word_Number starts with 0. Hm, are words within FS counted 0, 1, ... or do they start with 1? And what happens if Word_Number is out of range 0 (or 1) .. Number_of_Words. Constraint_Error or does it return ""?

Uh, ah! The parameter S is only in Word. Number_of_Words doesn't have it. Now I'm confused. How can Number_of_Words and Word work together correctly if only one knows what to use as the separator?
---------
So please, please use telling names. It doesn't take so much longer to invent them and write them down. And comment how the code is to be used!

Look at the RM to which extent the language defined subprograms are desribed. "Look into the code how it is used" is not the way to go.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 13:08   ` AdaMagica
@ 2017-09-25 14:04     ` reinert
  2017-09-25 16:14       ` AdaMagica
  2017-09-25 15:49     ` Frank Buss
  2017-09-25 16:08     ` Jeffrey R. Carter
  2 siblings, 1 reply; 20+ messages in thread
From: reinert @ 2017-09-25 14:04 UTC (permalink / raw)


Very good to get your comments. This code is something I have personally used long time - without having to communicate. Now it will be different :-)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 13:08   ` AdaMagica
  2017-09-25 14:04     ` reinert
@ 2017-09-25 15:49     ` Frank Buss
  2017-09-25 16:08     ` Jeffrey R. Carter
  2 siblings, 0 replies; 20+ messages in thread
From: Frank Buss @ 2017-09-25 15:49 UTC (permalink / raw)


On 09/25/2017 03:08 PM, AdaMagica wrote:
> A quote from the README:
> "You have to dig into the source code of cpros_test1 to figure out more if you want to use this simple (but for me useful) tool."

Can I have a t-shirt with it? "README: look at the code, dumbass!". I'm 
sure his co-workers loves him :-)

-- 
Frank Buss, http://www.frank-buss.de
electronics and more: http://www.youtube.com/user/frankbuss


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 13:08   ` AdaMagica
  2017-09-25 14:04     ` reinert
  2017-09-25 15:49     ` Frank Buss
@ 2017-09-25 16:08     ` Jeffrey R. Carter
  2017-09-25 18:34       ` reinert
  2 siblings, 1 reply; 20+ messages in thread
From: Jeffrey R. Carter @ 2017-09-25 16:08 UTC (permalink / raw)


On 09/25/2017 03:08 PM, AdaMagica wrote:
> A quote from the README:
> "You have to dig into the source code of cpros_test1 to figure out more if you want to use this simple (but for me useful) tool."
> 
> Am I the only one who finds this attitude terrible and unbearable for software engineering practices?

Not at all. And the code is terrible, too. There's a generic with a formal 
discrete type that makes assumptions about the actual type that are totally 
unjustified. The identifiers are cryptic and meaningless, often with a '1' 
tacked on the end for mo apparent reason. I could go on, but the reason I didn't 
comment before was because I didn't want to spend hours commenting on the 
problems I encountered looking at part of a single pkg.

-- 
Jeff Carter
"I fart in your general direction."
Monty Python & the Holy Grail
05


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 14:04     ` reinert
@ 2017-09-25 16:14       ` AdaMagica
  2017-09-25 17:51         ` reinert
  2017-09-25 17:53         ` reinert
  0 siblings, 2 replies; 20+ messages in thread
From: AdaMagica @ 2017-09-25 16:14 UTC (permalink / raw)


Am Montag, 25. September 2017 16:04:10 UTC+2 schrieb reinert:
> Very good to get your comments. This code is something I have personally used long time - without having to communicate. Now it will be different :-)

I guess commenting now will take longer than when you had done it while writing the code.

(To myself: I don't comment throw away test code when I try to understand some language features. The problem: Sometimes, I stumble over such old code I forgot to throw away and wonder what the hell I have done there.)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 16:14       ` AdaMagica
@ 2017-09-25 17:51         ` reinert
  2017-09-25 17:53         ` reinert
  1 sibling, 0 replies; 20+ messages in thread
From: reinert @ 2017-09-25 17:51 UTC (permalink / raw)


Funny with comments.

By the way: are there practical and light-weight command processors in Ada?
Maybe even some with easily readable code?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 16:14       ` AdaMagica
  2017-09-25 17:51         ` reinert
@ 2017-09-25 17:53         ` reinert
  2017-09-25 17:59           ` reinert
                             ` (2 more replies)
  1 sibling, 3 replies; 20+ messages in thread
From: reinert @ 2017-09-25 17:53 UTC (permalink / raw)


Funny with comments about readability.

By the way: are there practical and light-weight command processors in Ada? 
Maybe even some with easy readable code? 




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 17:53         ` reinert
@ 2017-09-25 17:59           ` reinert
  2017-09-26  9:55           ` Brian Drummond
  2017-09-26 17:07           ` Simon Wright
  2 siblings, 0 replies; 20+ messages in thread
From: reinert @ 2017-09-25 17:59 UTC (permalink / raw)


On Monday, September 25, 2017 at 7:53:21 PM UTC+2, reinert wrote:
> Funny with comments about readability.
> 
> By the way: are there practical and light-weight command processors in Ada? 
> Maybe even some with easy readable code?

I mean, other than my new famous cpros :-)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 16:08     ` Jeffrey R. Carter
@ 2017-09-25 18:34       ` reinert
  2017-09-26 16:25         ` AdaMagica
  0 siblings, 1 reply; 20+ messages in thread
From: reinert @ 2017-09-25 18:34 UTC (permalink / raw)


On Monday, September 25, 2017 at 6:08:37 PM UTC+2, Jeffrey R. Carter wrote:
> On 09/25/2017 03:08 PM, AdaMagica wrote:

..snip...
> 
> .... And the code is terrible, too. There's a generic with a formal 
> discrete type that makes assumptions about the actual type that are totally ..

Obs:
Could you be more informative about what in principle is wrong about using a formal discrete type for the generic? 

For info: the discrete type represents commands.

By the way: I made some cosmetic modifications wrt readability (to please the audience).

reinert


...snip...


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 17:53         ` reinert
  2017-09-25 17:59           ` reinert
@ 2017-09-26  9:55           ` Brian Drummond
  2017-09-26 12:56             ` reinert
  2017-09-26 17:07           ` Simon Wright
  2 siblings, 1 reply; 20+ messages in thread
From: Brian Drummond @ 2017-09-26  9:55 UTC (permalink / raw)


On Mon, 25 Sep 2017 10:53:19 -0700, reinert wrote:

> Funny with comments about readability.
> 
> By the way: are there practical and light-weight command processors in
> Ada?
> Maybe even some with easy readable code?

What do you mean by "command processor"? If you mean something to parse 
an executable's command line, there's the Generic Command Line Parser, 
GCLP at 
https://launchpad.net/gclp

I've used it a few times, and like it.

-- Brian

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-26  9:55           ` Brian Drummond
@ 2017-09-26 12:56             ` reinert
  2017-09-26 13:13               ` Dmitry A. Kazakov
  0 siblings, 1 reply; 20+ messages in thread
From: reinert @ 2017-09-26 12:56 UTC (permalink / raw)


Thanks, this was something. 

Before I dive deeper into it, by "command processor" I did here mean something with an interactive functionality, for short:

1. read a command from terminal and the possibility to process 
   it (and one normally gets a response on the terminal or a graphical window -
   or some hardware response, robot movement etc).

2. read command lines form a file (for example by a command like 
   "do <commandfile> <arg1> <arg2> ... <argN>" and process the commands in 
   sequence.  This "command file" may include another 
   "do <another_command_file" etc indefinitely deep.

3. Some arithmetic, operations for concatination (string handling) 
   etc may be included. A "delay" (generally timing) may be included.

In other words something with a scripting functionality.  I am not sure
this should be called "parsing"?

Could it be argued that such a "command processor" could be included in a standard Ada package? Yes, some smartass' may argue that this is easy to
program and do oneself, but such functionality may help development and
testing of programms?

reinert


On Tuesday, September 26, 2017 at 11:55:22 AM UTC+2, Brian Drummond wrote:
> On Mon, 25 Sep 2017 10:53:19 -0700, reinert wrote:
> 
> > Funny with comments about readability.
> > 
> > By the way: are there practical and light-weight command processors in
> > Ada?
> > Maybe even some with easy readable code?
> 
> What do you mean by "command processor"? If you mean something to parse 
> an executable's command line, there's the Generic Command Line Parser, 
> GCLP at 
> https://launchpad.net/gclp
> 
> I've used it a few times, and like it.
> 
> -- Brian

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-26 12:56             ` reinert
@ 2017-09-26 13:13               ` Dmitry A. Kazakov
  0 siblings, 0 replies; 20+ messages in thread
From: Dmitry A. Kazakov @ 2017-09-26 13:13 UTC (permalink / raw)


On 26/09/2017 14:56, reinert wrote:

> Could it be argued that such a "command processor" could be included
> in a standard Ada package?
No. The syntax of and the environment where execution should take effect 
can be any. Why should Ada prefer one or another?

> Yes, some smartass' may argue that this is easy to program and do
> oneself, but such functionality may help development and testing of
> programms?
No. Firstly there is no reason to use command line interface for 
developing and testing programs. Secondly tool-chains to support 
software developing processes are out of the language's direct scope.

P.S. There are plenty parsing libraries in Ada. E.g.

    http://www.dmitry-kazakov.de/ada/components.htm#Parsers_etc

It comes with Ada 95 expression parser and calculator examples.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 18:34       ` reinert
@ 2017-09-26 16:25         ` AdaMagica
  2017-09-27  6:07           ` reinert
  0 siblings, 1 reply; 20+ messages in thread
From: AdaMagica @ 2017-09-26 16:25 UTC (permalink / raw)


Am Montag, 25. September 2017 20:34:51 UTC+2 schrieb reinert:
> By the way: I made some cosmetic modifications wrt readability (to please the audience).

That's the wrong attitude - we do not want to be pleased...

All we strive for is good software engineering practices with well documented code and telling identifiers.

Do you really think Split_String (former Rsplit) has considerably improved?


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-25 17:53         ` reinert
  2017-09-25 17:59           ` reinert
  2017-09-26  9:55           ` Brian Drummond
@ 2017-09-26 17:07           ` Simon Wright
  2 siblings, 0 replies; 20+ messages in thread
From: Simon Wright @ 2017-09-26 17:07 UTC (permalink / raw)


reinert <reinkor@gmail.com> writes:

> Funny with comments about readability.
>
> By the way: are there practical and light-weight command processors in Ada?
> Maybe even some with easy readable code?

You might look at https://github.com/kburtch/SparForte


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-26 16:25         ` AdaMagica
@ 2017-09-27  6:07           ` reinert
  0 siblings, 0 replies; 20+ messages in thread
From: reinert @ 2017-09-27  6:07 UTC (permalink / raw)


Working on it :-)

Included "cpros_info.txt" as a start. For me this is for learning to be clever on publishing software. And I need to do it as fast. I am used to publish in scientific journals - but I am novice on publishing software :-)
Never done it before.

reinert 

On Tuesday, September 26, 2017 at 6:25:15 PM UTC+2, AdaMagica wrote:
> Am Montag, 25. September 2017 20:34:51 UTC+2 schrieb reinert:
> > By the way: I made some cosmetic modifications wrt readability (to please the audience).
> 
> That's the wrong attitude - we do not want to be pleased...
> 
> All we strive for is good software engineering practices with well documented code and telling identifiers.
> 
> Do you really think Split_String (former Rsplit) has considerably improved?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-24 15:07 My first test of github: cpros - lightweight Ada command processor reinert
  2017-09-25  7:20 ` reinert
@ 2017-09-27 16:16 ` Jacob Sparre Andersen
  2017-09-27 17:15   ` reinert
  2017-09-28  8:11   ` reinert
  1 sibling, 2 replies; 20+ messages in thread
From: Jacob Sparre Andersen @ 2017-09-27 16:16 UTC (permalink / raw)


reinert <reinkor@gmail.com> writes:

> I am preparing to use github for an Ada project. To make the learning
> curve steeper, I now put a small test project on github:
>
> https://github.com/reinertk/cpros
>
> Yes, things are missing here, but could anybody make some valuable
> comments to help make the learning faster? Any problem to get access
> to it?

It is always good to see more Ada sources on GitHub.

Even though I prefer Mercurial, I must admit that Git isn't very hard to
learn to use.

Some friendly suggestions:

+ It isn't necessary to create the object directory first, if you pass
  "gprbuild" a "-p" argument.

+ If I press Ctrl-D, you report an "End_Error" exception.  It might look
  nicer, if you just caught it and exited the shell.  Conventional Unix
  shell style is to terminate successfully (exit code 0) on
  end-of-input.

Greetings,

Jacob
-- 
Black Hole: Where the universe made a Divide by Zero.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-27 16:16 ` Jacob Sparre Andersen
@ 2017-09-27 17:15   ` reinert
  2017-09-28  8:11   ` reinert
  1 sibling, 0 replies; 20+ messages in thread
From: reinert @ 2017-09-27 17:15 UTC (permalink / raw)


Thanks. I buy this and correct soon.

By the way: I think it is cool that the "command processor", cpros, though a bit primitive, consists of only (about) 150 program lines of code depending on how one count program lines.

reinert 

On Wednesday, September 27, 2017 at 6:16:21 PM UTC+2, Jacob Sparre Andersen wrote:
> reinert <reinkor@gmail.com> writes:
> 
> > I am preparing to use github for an Ada project. To make the learning
> > curve steeper, I now put a small test project on github:
> >
> > https://github.com/reinertk/cpros
> >
> > Yes, things are missing here, but could anybody make some valuable
> > comments to help make the learning faster? Any problem to get access
> > to it?
> 
> It is always good to see more Ada sources on GitHub.
> 
> Even though I prefer Mercurial, I must admit that Git isn't very hard to
> learn to use.
> 
> Some friendly suggestions:
> 
> + It isn't necessary to create the object directory first, if you pass
>   "gprbuild" a "-p" argument.
> 
> + If I press Ctrl-D, you report an "End_Error" exception.  It might look
>   nicer, if you just caught it and exited the shell.  Conventional Unix
>   shell style is to terminate successfully (exit code 0) on
>   end-of-input.
> 
> Greetings,
> 
> Jacob
> -- 
> Black Hole: Where the universe made a Divide by Zero.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: My first test of github: cpros - lightweight Ada command processor
  2017-09-27 16:16 ` Jacob Sparre Andersen
  2017-09-27 17:15   ` reinert
@ 2017-09-28  8:11   ` reinert
  1 sibling, 0 replies; 20+ messages in thread
From: reinert @ 2017-09-28  8:11 UTC (permalink / raw)


Did it now. 5 points to you :-)

I had no clue about "gprbuild" with a "-p" :-)

Next step is to introduce a "help" feature.
Due to the "micro" size of cpros, it may have a niche for micro-controllers?

reinert



On Wednesday, September 27, 2017 at 6:16:21 PM UTC+2, Jacob Sparre Andersen wrote:
> reinert <reinkor@gmail.com> writes:
> 
> > I am preparing to use github for an Ada project. To make the learning
> > curve steeper, I now put a small test project on github:
> >
> > https://github.com/reinertk/cpros
> >
> > Yes, things are missing here, but could anybody make some valuable
> > comments to help make the learning faster? Any problem to get access
> > to it?
> 
> It is always good to see more Ada sources on GitHub.
> 
> Even though I prefer Mercurial, I must admit that Git isn't very hard to
> learn to use.
> 
> Some friendly suggestions:
> 
> + It isn't necessary to create the object directory first, if you pass
>   "gprbuild" a "-p" argument.
> 
> + If I press Ctrl-D, you report an "End_Error" exception.  It might look
>   nicer, if you just caught it and exited the shell.  Conventional Unix
>   shell style is to terminate successfully (exit code 0) on
>   end-of-input.
> 
> Greetings,
> 
> Jacob
> -- 
> Black Hole: Where the universe made a Divide by Zero.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-09-28  8:11 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-24 15:07 My first test of github: cpros - lightweight Ada command processor reinert
2017-09-25  7:20 ` reinert
2017-09-25 13:08   ` AdaMagica
2017-09-25 14:04     ` reinert
2017-09-25 16:14       ` AdaMagica
2017-09-25 17:51         ` reinert
2017-09-25 17:53         ` reinert
2017-09-25 17:59           ` reinert
2017-09-26  9:55           ` Brian Drummond
2017-09-26 12:56             ` reinert
2017-09-26 13:13               ` Dmitry A. Kazakov
2017-09-26 17:07           ` Simon Wright
2017-09-25 15:49     ` Frank Buss
2017-09-25 16:08     ` Jeffrey R. Carter
2017-09-25 18:34       ` reinert
2017-09-26 16:25         ` AdaMagica
2017-09-27  6:07           ` reinert
2017-09-27 16:16 ` Jacob Sparre Andersen
2017-09-27 17:15   ` reinert
2017-09-28  8:11   ` reinert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox