Re: gEDA-user: Perl

2011-05-31 Thread Jim Lynch

On 05/27/2011 11:54 AM, DJ Delorie wrote:

This is more anecdotal than anything else...


I'm a Perl fan myself.

(shudder)



Javascript!


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-31 Thread Thomas Oldbury
   Python!

   On 31 May 2011 11:26, Jim Lynch [1]j...@k4gvo.com wrote:

   On 05/27/2011 11:54 AM, DJ Delorie wrote:

 This is more anecdotal than anything else...

 I'm a Perl fan myself.

 (shudder)

 Javascript!

   ___
   geda-user mailing list
   [2]geda-user@moria.seul.org
   [3]http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

References

   1. mailto:j...@k4gvo.com
   2. mailto:geda-user@moria.seul.org
   3. http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-30 Thread John Doty

On May 29, 2011, at 12:01 AM, Dave McGuire wrote:

  This is my opinion, speaking as a professional developer of both hardware 
 and software: Scheme was a good choice for gEDA, and it should be left alone. 
  The chosen implementation of Scheme, guile, may not be the best tool for the 
 job right now, but the language is.

Abandoning Guile for this job means abandoning nearly all of the core code in 
gnetlist, because that's written in C, and uses Guile's FFI. That is a possible 
way to proceed. A rewrite of gnetlist in straight Scheme (which is certainly 
possible) would free us to choose a Scheme implementation. But who's 
volunteering?

On the other hand, the totality of what we're discussing is also beyond 
gnetlist's capability as written. We can translate package attributes easily, 
but trickier mappings will be messy at best, and annotation is impossible. 
Given how much trouble fixing the attribute censorship bug was, refactoring the 
gnetlist we have now to adequately broaden its capability to allow it to 
address these issues seems likely to take years.

So, one way or another, we're looking at a new tool, I think. Maybe we keep the 
old gnetlist around and feed it modified/annotated schematics.

 
  There will always be people who don't like a particular choice. That's true 
 of anything.  All changing it will accomplish is changing who is pleased and 
 who is disgusted.

I'm with DJ here: contributions will decide. The language doesn't matter so 
much to me.   The big issue here is that our tool, gnetlist, hides much of the 
design data behind its API. This makes general-purpose design translation 
tricky, and annotation impossible. So, the first challenge to the various 
language advocates here is to prototype a fundamental API that reveals all, in 
a way convenient for higher level factors to exploit.

John Doty  Noqsi Aerospace, Ltd.
http://www.noqsi.com/
j...@noqsi.com




___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-28 Thread Karl Hammar
wpd:
...
 I stopped liking perl when I learned why this script didn't do what I
 expected it to do:

Don't expect too much. Every computer system/os/language has their own
strange things/visions/words that does not mean what you expect them to.

 #!/usr/bin/perl -w
 my @array = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
 print length(@array), \n;

$ man perlfunc | grep -A5 'length EXPR'
   length EXPR
   length  Returns the length in characters of the value of EXPR.
   If EXPR is omitted, returns length of $_.  Note that
   this cannot be used on an entire array or hash to find
   out how many elements these have.  For that, use
   scalar @array and scalar keys %hash respectively.

 Maybe things have changed since then, but I spent way too much time
 being confused by this.

Badly spent time, check the man page.

///

If you don't like perl/scheme/pythonn/ruby/c/whatever ---
don't use it, but stop complaining about it.

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57




___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-28 Thread Dave McGuire

On 5/27/11 10:55 PM, John Doty wrote:

My intro to Perl was about 20 years ago, when one of my Japanese
colleagues asked me to bring a couple of copies of the Perl book
over, because it was unavailable in Japan. So, I bought them at
Quantum Books. I read one of them on the long plane flight. My
impression then is the same as it is now: Perl is a crazy, complex,
undisciplined shotgun marriage between AWK and sh. The contrast
between the extreme discipline of AWK's design and Perl's sloppiness
is striking.


  I share your opinion of Perl.  There's no doubt of its power, but 
it's a sloppy, disgusting mess that almost always results in completely 
opaque and unmaintainable code.


  Sure, it is possible to write good code in Perl, but almost nobody 
does, because the language doesn't encourage writing good code, and the 
almost cultlike culture surrounding it largely doesn't recognize it.



And I've written code in dozens of languages (I lost count decades
ago). I won't recommend FORTRAN II, METASYMBOL, SNOBOL3, PL/I, or
FORTH for this job ;-)


  I think we should consider Intercal.  Or perhaps DCL. =)

  This is my opinion, speaking as a professional developer of both 
hardware and software: Scheme was a good choice for gEDA, and it should 
be left alone.  The chosen implementation of Scheme, guile, may not be 
the best tool for the job right now, but the language is.


  There will always be people who don't like a particular choice. 
That's true of anything.  All changing it will accomplish is changing 
who is pleased and who is disgusted.


 -Dave

--
Dave McGuire
Port Charlotte, FL


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-28 Thread Karl Hammar
Karl:
 wpd:
...
  #!/usr/bin/perl -w
  my @array = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
  print length(@array), \n;
...
  Maybe things have changed since then, but I spent way too much time
  being confused by this.

If you really want to understand why this prints 2, look at this:

$ perl -e 'print length(1,2), \n;'
Too many arguments for length at -e line 1, near 2)
Execution of -e aborted due to compilation errors.
$

This means the length wants just one argument.

Now, @array is either the array of numbers above, or
@array is the number of elements of the array, i.e. 11.
It depend on the context, if it is vector or scalar
context.

Since length only wants one argument, @array is treated as a
scalar, which is 11, and the length of the string 11 is 2.

If you want to print out the number of elements in @array,
you have to force it to a scalar context as in:

print scalar(@array), \n;

 or
 
print @array+0, \n;

 Badly spent time, check the man page.

 If you don't like perl/scheme/pythonn/ruby/c/whatever ---
 don't use it, but stop complaining about it.

Sorry for being a little harsh.

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57




___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


gEDA-user: Perl

2011-05-27 Thread DJ Delorie

This is more anecdotal than anything else...

  I'm a Perl fan myself.
 
 (shudder)

Just before I learned Perl (WAY before python existed, before perl 5
even), my manager was talking to *his* manager about this nifty new
tool called perl that they just discovered.  Apparently, their
metric for whether it was good or not was whether or not I knew how to
use it already ;-)

Does DJ know how to use it?
No
Why not?
He hasn't needed to yet.

Shortly after, I needed it, so I learned it.  It'll be the same with
Python, just like it was with Scheme.  I'm a compiler engineer -
picking up languages is second nature to me.

It happens that most of the Fedora infrastructure is all python
scripts anyway, so it's not a big deal if I have to learn it, it's
just that I've been using Perl so far and it always seems to have the
features I want.  In this case, the key feature is:

You can implement arrays of hashes, hashes of arrays, arrays of
arrays, and hashes of hashes.

This feature, for exmaple, allows us to encode a complete gEDA project
(sch+pcb+whatever) in a single perl variable!

But as they say, if there's a way to do it in Perl, there's more than
one way to do it in Perl, so yes, the likelyhood of inconsistent
styles is very high.

(hmmm... perl pcb exporter hid...)


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-27 Thread Mark Rages
On Fri, May 27, 2011 at 10:54 AM, DJ Delorie d...@delorie.com wrote:
 Shortly after, I needed it, so I learned it.  It'll be the same with
 Python, just like it was with Scheme.  I'm a compiler engineer -
 picking up languages is second nature to me.

Python is really easy to learn.  Dive in: http://diveintopython.org.
With your experience, it will take you a day or less.


 You can implement arrays of hashes, hashes of arrays, arrays of
 arrays, and hashes of hashes.

 This feature, for exmaple, allows us to encode a complete gEDA project
 (sch+pcb+whatever) in a single perl variable!

Can't you do this in any dynamic language?

Regards,
Mark
markrages@gmail


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-27 Thread David C. Kerber
 

 -Original Message-
 From: geda-user-boun...@moria.seul.org 
 [mailto:geda-user-boun...@moria.seul.org] On Behalf Of DJ Delorie
 Sent: Friday, May 27, 2011 11:55 AM
 To: gEDA user mailing list
 Subject: gEDA-user: Perl

...

 You can implement arrays of hashes, hashes of arrays, arrays 
 of arrays, and hashes of hashes.

Just like Java!

 
 This feature, for exmaple, allows us to encode a complete gEDA project
 (sch+pcb+whatever) in a single perl variable!
 
 But as they say, if there's a way to do it in Perl, there's 
 more than one way to do it in Perl, so yes, the likelyhood of 
 inconsistent styles is very high.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-27 Thread Patrick Doyle
On Fri, May 27, 2011 at 11:54 AM, DJ Delorie d...@delorie.com wrote:

 This is more anecdotal than anything else...

  I'm a Perl fan myself.

 (shudder)

Oh goody!  flame war bate!

I stopped liking perl when I learned why this script didn't do what I
expected it to do:

#!/usr/bin/perl -w
my @array = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
print length(@array), \n;

Maybe things have changed since then, but I spent way too much time
being confused by this.

--wpd


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: Perl

2011-05-27 Thread John Doty

On May 28, 2011, at 12:54 AM, DJ Delorie wrote:

 
 This is more anecdotal than anything else...
 
 I'm a Perl fan myself.
 
 (shudder)
 
 Just before I learned Perl (WAY before python existed, before perl 5
 even), my manager was talking to *his* manager about this nifty new
 tool called perl that they just discovered.  Apparently, their
 metric for whether it was good or not was whether or not I knew how to
 use it already ;-)
 
 Does DJ know how to use it?
 No
 Why not?
 He hasn't needed to yet.

My intro to Perl was about 20 years ago, when one of my Japanese colleagues 
asked me to bring a couple of copies of the Perl book over, because it was 
unavailable in Japan. So, I bought them at Quantum Books. I read one of them on 
the long plane flight. My impression then is the same as it is now: Perl is a 
crazy, complex, undisciplined shotgun marriage between AWK and sh. The contrast 
between the extreme discipline of AWK's design and Perl's sloppiness is 
striking.

 
 Shortly after, I needed it, so I learned it.  It'll be the same with
 Python, just like it was with Scheme.  I'm a compiler engineer -
 picking up languages is second nature to me.

I've been a compiler engineer a couple of times, back when a lot of design 
discipline was needed (because without care, your code either wouldn't fit in 
memory, or would be intolerably slow from disk thrashing). A simple related 
project involved implementing structured flow control in an assembly language: 
that had long-lasting consequences 
(http://www.frankston.com/public/?name=ImplementingVisiCalc). And I've written 
code in dozens of languages (I lost count decades ago). I won't recommend 
FORTRAN II, METASYMBOL, SNOBOL3, PL/I, or FORTH for this job ;-)

 
 It happens that most of the Fedora infrastructure is all python
 scripts anyway, so it's not a big deal if I have to learn it, it's
 just that I've been using Perl so far and it always seems to have the
 features I want.  In this case, the key feature is:
 
 You can implement arrays of hashes, hashes of arrays, arrays of
 arrays, and hashes of hashes.

That's not a feature in my book: it's fundamental to this class of language. 
Composition.

 
 This feature, for exmaple, allows us to encode a complete gEDA project
 (sch+pcb+whatever) in a single perl variable!

No problem doing that in Python. Or even ECD BASIC in 1978.

 
 But as they say, if there's a way to do it in Perl, there's more than
 one way to do it in Perl, so yes, the likelyhood of inconsistent
 styles is very high.

I can't imagine a sane *design* process for anything even moderately 
complicated in Perl.

John Doty  Noqsi Aerospace, Ltd.
http://www.noqsi.com/
j...@noqsi.com




___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user