Page 3 of 17 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 165

Thread: Programmer's Den

  1. #21
    Mens bona regnum possidet ferrus's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Location
    Barcelona, Catalonia
    Posts
    5,669
    Quote Originally Posted by latch View Post
    I started in BASIC in 1982 and I still use it.

    I get a lot of guff about it and I laugh.

    All the way to the bank.
    Heh.
    Die Logik ist keine Lehre, sondern ein Spiegelbild der Welt. Die Logik ist transcendental. - Wittgenstein

  2. #22
    schlemiel Faust's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Posts
    2,420
    Does anyone care for hacking, or hack-zines? I read the 2600 quarterly, even if I only have a surface level understanding of some articles. Fun stuff.

  3. #23
    ..you don't know me LordLatch's Avatar
    Type
    INtP
    Join Date
    Dec 2013
    Posts
    7,520
    INTPx Award Winner
    Quote Originally Posted by ferrus View Post
    Pretty much, yeah.
    Stand clear of the closing doors, please.

  4. #24
    Member
    Type
    INTP
    Join Date
    Jan 2014
    Location
    Upstate, New York, U.S. of A. -- Earth
    Posts
    648
    Quote Originally Posted by ferrus View Post
    And I can testify to this.
    Though I learned machine code and assembly before BASIC, I attempted to learn Lisp at age 39 after decades of misuse of the imperative bent of BASIC and procedural bent of Pascal, C, etc.
    That I had been exposed to APL and Logo along the way may have both somewhat forestalled the mental mutilation and kept my brain supple enough to extend the functional paradigm of APL (and Logo, had I only used it thus) while displacing the imperative, side-effects `rich' mental Juggernaut promoted by years of (mis)using BASIC.
    {aside: I started using BASIC in the fall of '78 on a 4k -- yes, that's k as in kilo -- TRS-80 model 1}

    I can still code in BASIC.
    Though I'm reminded of the definition of a gentleman as a man who can play the accordion ... and chooses not to.

    Whereas @latch manifests the Liberace response to music critics, "I cried all the way to the bank.", I haven't found the profit motivation insufficient to lure me away with PLAYING with emacs lisp as a form of mental therapy for the mental mutilation and self-abuse of my misspent youth.

    Though, to be more-accurate -- if not `fair' -- thinking in lisp has displaced the single-rung mindset engendered while using BASIC, Pascal, c, and c++;
    The single-rung cognition corresponding with the `mental mutilation' has been displaced by metacognition and metaprogramming.
    I quite often think of how to get elisp to generate the functional work-alikes in python, BASIC, javaScript ... several languages rather than just one.
    Last edited by gps; 05-13-2014 at 07:58 PM.

  5. #25
    ..you don't know me LordLatch's Avatar
    Type
    INtP
    Join Date
    Dec 2013
    Posts
    7,520
    INTPx Award Winner
    I started coding in machine code also with dip switches on a wire wrap computer long before I did anything BASIC in my Timex Sinclair 1000. I have coded in ASM, c, c++, java, php, Python, VB, B4A, GLBasic, Euphoria and others I've forgotten.

    My android apps are written in B4A as I find Java too verbose and ugly to look at. I can whip out a simple app that's market ready(scaling correctly to any device) in half a day if the mood strikes me. Try that in Java- it takes 3 times as many lines of code to do anything. Write 3 classes to draw a picture? Bleh. Games take longer as I usually write a new engine every time.
    Stand clear of the closing doors, please.

  6. #26
    Member
    Type
    INTP
    Join Date
    Jan 2014
    Location
    Upstate, New York, U.S. of A. -- Earth
    Posts
    648
    Not sure whether this is programming or closer to metaprogramming -- perhaps pedagogy -- but I've had some nascent ideas for introducing `programming'/scripting/composing_incantations commingling for long enough to produce this idea.
    It goes like this ...

    Most folks -- literate in at least one so-called `natural' language -- are capable of wrapping their minds around what programmers call `literals' ... both strings of characters as used in natural language and numbers composed of digits.
    When they compose `text' they do so with this end goal in mind ... not the production of a recipe or incantation which produces the text.

    So ... here's my idea: Could the mental processes underpinning `programming' per se be promoted by exploiting metacognition from a bass ackwards perspective of starting with a finished snippet of text or quote and working backwards to craft one-or-more magical incantations -- in any given syntax -- which can generate the end-state text via a mechanized sorcerer's apprentice (EG translator, where translator = compiler or interpreter/REPL)?

    As many, if not most, non-programmers prefer natural language to, say, math might it be easier for such folks to start out with natural language and learn how to store such as sequences of symbols programmers think of as `strings', manipulate these sequences of characters with action words towards the ends of structurally decomposing and recomposing language text as the coin of the realm for the web and this group?

    Code:
    ;<---- The semicolon is the comment character.  Everything remaining on the line is ignored by the interpreter/REPL and optional byte-code compiler
    
    ;;; symbolic expression a_la the syntax of emacs lisp
    
    (let ; Everything in a let block has local scope, as contrasted with global/universal scope
    (
        (glue " ") ; a local symbol/variable for use ... assigned/bound to the space character.
    )
     ;v--- body of let block
      (mapconcat ;<-- The inverse of split-string; it concatenates (EG joins-together sequences of characters)
        (function identity) ; the first arg for mapconcat is a function.  The second is a string, the third/last is an optional string of delimiters
        (split-string ;<-- The inverse of mapconcat; split-string splits a sequence of characters into a list of sub-sequences (possible words) delimited by one-or-more characters.
    
    "As many, if not most, non-programmers prefer natural language to, say, math might it be easier for such folks to start out with natural language and learn how to store such as sequences of symbols programmers think of as `strings', manipulate these sequences of characters with action words towards the ends of structurally decomposing and recomposing language text as the coin of the realm for the web and this group?"
    
       glue ; we'll assume that the words of a sentence are glued together with a single space.
    
        );split-string 
    
        glue ; we'll use the same glue to re-assemble the parts as we used to produce the parts/words/substrings via split-string.
      );mapconcat 
    
     ;^--- body of let block
    );let
    So ... what do you all think?
    Every decent programming language supports strings or vectors of character codes.
    Might we interest some of the language lovin' non-programmers with/by this approach?
    Last edited by gps; 05-13-2014 at 08:03 PM. Reason: duh! I replaced the quote tag with a CODE tag as I had intended but failed to execute as desired.

  7. #27
    know nothing pensive_pilgrim's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Posts
    4,059
    I'm not really getting what that is intended to do... take a string apart and put it back together again? It might help if you use the code tags so you can use indentation and maybe italicize the comments.

  8. #28
    Member
    Type
    INTP
    Join Date
    Jan 2014
    Location
    Upstate, New York, U.S. of A. -- Earth
    Posts
    648
    Quote Originally Posted by pathogenetic_peripatetic View Post
    I'm not really getting what that is intended to do... take a string apart and put it back together again?
    Yep. split a sentence-in-a-string into words then re-assemble them back into the original sentence.
    BTW, many math weenies come to believe in the superstition that inverse functions MUST work on numbers ONLY;
    this example demonstrates that inverse functions exist for the domain of WORDS, sentences, paragraphs ... natural language domain.

    Quote Originally Posted by pathogenetic_peripatetic View Post
    It might help if you use the code tags so you can use indentation and maybe italicize the comments.
    Point taken ... however momentarily, for the nonce.


    Code:
    ;<---- The semicolon is the comment character. Everything remaining on the line is ignored by the interpreter/REPL and optional byte-code compiler
    
    ;;; symbolic expression a_la the syntax of emacs lisp
    (;let
     let ; Everything in a let block has local scope, as contrasted with global/universal scope
     (;local-bindings
      (glue " ") ; a local symbol/variable for use ... assigned/bound to the space character.
     );local-bindings
     ;v--- body of let block
      (;mapconcat
        mapconcat ;<-- The inverse of split-string; it concatenates (EG joins-together sequences of characters)
        (function identity) ; the first required parameter for mapconcat; a function
        ;v-- the string to be split
       (;split-string
        split-string ;<-- The inverse of mapconcat; split-string splits a sequence of characters into a list of sub-sequences (possible words) delimited by one-or-more characters.
    "As many, if not most, non-programmers prefer natural language to, say, math might it be easier for such folks to start out with natural language and learn how to store such as sequences of symbols programmers think of as `strings', manipulate these sequences of characters with action words towards the ends of structurally decomposing and recomposing language text as the coin of the realm for the web and this group?"
    
      glue ; we'll assume that the words of a sentence are glued together with a single space. This is the 3rd and final required parameter for split-string
      );split-string
        ;^-- the string to be split
      glue ; we'll use the same glue.  
     );mapconcat
     ;^--- body of let block
    );let
    
    ;;;; And this may be the LAST time I pander to such nonsense, as any text editor worth it's salt should be able to display matched pairs of punctuation ... parentheses included.
    ;;;; If you're a real/serious programmer you should be able to copy code nested within BBCODE code tags into the editor of your choice and/or a translator as use it as-is without special hand holding.
    {aside: Having italiicized and quasi-tagified the `code' I'm painfully aware of how less is more.
    The code was cleaner and less cluttered in many ways with only the use of same-level indentation for matched pairs of parentheses, IMO.
    }

    I could use a pair of approaches, both towards the end result of revealing absurdity.
    One would be to redesign lisp/scheme to use XML/HTML/XHTML style pairs of tags which replace pairs of parentheses.
    Another would start with, say, HTML then converting all tags into matched pairs of parentheses a_la Lisp then inserting the name of the former tag in the position of the function name a_la Lisp.

    By way of helping you and others tasked with attempting to make sense of my nonsense-until-proven-otherwise content ... rather than using a lexical means -- which MOST programmers use -- I used SPATIAL cluing.
    I clue in the reader/viewer by placing many -- not all -- matched pairs of parentheses at the same level of indentation.
    This (mal)practice of mine deviates from traditional lisp/scheme representation in which the starting parentheses are indented, but the closing/ending parentheses are all glommed together at the end of a given symbolic expression.
    Though IF one `thinks' spatially -- as do I -- it's much easier to visually spot/detect matched pairs of parentheses.

    Yes, I've used a form of mock tagification via the use the comment character like so:
    (;this

    );this

    which might be used to re-express a nested structure familiar to XML coders
    Code:
    (;html
      (;head
    
      );head
      (;body
    
      );body
    );html
    So ... if you think about it ... notations which use XML style tags ARE just as parenthetical as Lisp syntax EXCEPT they multiplex the function name into the parenthetical delimiters commonly referred to as tags.



    This syntactical tangent aside, what do you think about the crux of my idea?
    JavaScript, for example, has a function named `split' which does pretty much the same thing as the elisp function named `split-string'
    Likewise, one can JOIN all the substrings held in a javaScript array just as one can join the substrings held in an emacs lisp list via `mapconcat'

    Every programming language worth it's salt allows for the splitting and joining/concatenation of strings.
    Might WE -- we programming types -- use this FACT to craft programs which are more-inclusionary of our natural-languages preferring peers and playmates here in this group?
    I'm not talking about a specific language here; I'm talking about STRINGS and string functions ... whether implemented via the logo tag, Php, javaScript ... whatever.
    Last edited by gps; 05-13-2014 at 06:37 AM.

  9. #29
    Member
    Type
    INTP
    Join Date
    Jan 2014
    Location
    Upstate, New York, U.S. of A. -- Earth
    Posts
    648
    Quote Originally Posted by latch View Post
    I started coding in machine code also with dip switches on a wire wrap computer long before I did anything BASIC in my Timex Sinclair 1000.
    Oh yeah?!!!
    Well ... I started coding in machine code on a Univac Digital Trainer-- featuring magnetic core memory -- designed by Seymour Cray, using neon-lit push-button switches grouped in threes to facilitate the entry of binary-coded octal.
    And I walked uphill both ways to a one-room school house and back with a still-hot baked potato in each coat pocket to keep my hands from freezing all school season long ... before the ice sheets retreated back towards the arctic circle.

    hint: only one of these assertions is false.

    P.S.
    The instruction set of the Z-80 is a dream compared to that of the UDT; the Z-80 instruction set is microcoded, and having the prime register set available is really handy for processing interrupts as one can swap register sets as an alternative to pushing and popping register contents.
    I did an application project for my BET EE degree by piggy backing 16k of RAM (EG 1/4 of the total memory map) atop an extant bank then having software copy upon boot-up the contents of the ROM into that RAM, switching out the ROM and in the RAM holding the RAM contents ... on a z-80-containing TRS-80 model I.
    When I obtained a Sinclair years later I made an interface to a REAL keyboard so I wouldn't have to tolerate that fucking Chiclets keyboard.
    My quest for A Sinclair QL was never sated ... the 68008 was a thing of beauty ... though not as beautiful as an Amiga with 680x0 with custom coprocessor(s) chip set.
    Last edited by gps; 05-13-2014 at 08:05 PM.

  10. #30
    ..you don't know me LordLatch's Avatar
    Type
    INtP
    Join Date
    Dec 2013
    Posts
    7,520
    INTPx Award Winner
    Quote Originally Posted by gps View Post
    Oh yeah?!!!
    Well ... I started coding in machine code on a Univac Digital Trainer-- featuring magnetic core memory -- designed by Seymour Cray, using neon-lit push-button switches grouped in threes to facilitate the entry of binary-coded octal.
    Oh yeah?!!! I live the city Seymour Cray died in and I know the spot! And Tesla lived here too and I know the spot where his lab was!

    Quote Originally Posted by gps View Post
    When I obtained a Sinclair years later I made an interface to a REAL keyboard so I wouldn't have to tolerate that fucking Chiclets keyboard.
    I did this to with my Sinclair 1000(with 16k module!). I bought a keyboard from Radio Shack, cut and soldered the circuit board to match the pinout of the computer's membrane keyboard and screwed them both to a piece of plywood. No small feat for a 13 year old.



    *I may have been 12.
    Stand clear of the closing doors, please.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •