Showing posts with label languages. Show all posts
Showing posts with label languages. Show all posts

Monday, November 17, 2014

C/C++ Must Die

It is a four hour forward only text. I am not in the mood to clean. reread, refactor, split or fix any mistakes right now, and I am not saying sorry for that, because it is how it is written with this limited keyboard interface that I practiced over my lifetime. I am sorry only if you won't be able to read or understand that, because it would mean I made it all worse. I am already at the point that I want to filter it straight to the subject, reread and fix all typos, obscure moments, digressions and words, but I've already out of time and it might happen that there won't be any time for that later.


My system background is [assembly] --> [pascal] --> [c] --> [php] --> [python], so C is not my favorite language, I am in any way attached to it and don't exhibit a feeling of nostalgia and deep sadness when thinking about what changed in the past 40 years that passed since its invention. What I really regret is that there is no a place like Bell Labs anymore that could prevent bloody enterprise from formatting people to the bloody business mindset. Formatting so badly that you even need a ton of startups to just produce ideas (not mentioning getting them right).

So, in the past 40 years, a new language appeared called Python. I don't think that Guido knew the words "usability", "user experience" or CJM when inventing it - it was just natural and human like, just because it was not engineered, but made through feeling of a human, who likes Monty Python and doesn't follow accepted rituals of human organisms in suits. I understand his desire to keep CWI copyright in place - it is a living reminder about another environment that made this thing possible. Unlike these bloody corporations that keep pressure on what you need to do and when to deliver. There is not much creativity and freedom right now. Those tiny groups of people who gather through the internet try to change the things. But the poor expressive power of non-native English language, time gap and invisible mood and attitude changes make it almost impossible to provide a stable communication channel that will not limit itself only to a narrow band of appreciation, joy and positive emoji. All negative emotions, drama, critics and depressions exists there for a reason - to express the importance of details and adapt them.

Accepted rituals of human organisms in suits. It is hard to be human. So hard that the rational part of us will never accept the idea that I, me, myself are limited. Humans had somehow devised the ethics, culture and rituals to deal with that. Implemented complex system of oppressing behavior and enforcing rules to make everyone the same and keep balance. Capitalist economy made it possible to compete, to make a gameplay to measure and estimate your value compared to someone else instead of just killing him, because his will to live just dampens yours. Money had been chosen as a universal way to solve conflicts and it worked for a few generations. Until a new generation appeared that didn't not care about conflicts and didn't see why would anyone should conflict if everything you need is money. We are still limited humans who fail to see the balance and yet we are trying to prove that we are the best, we need to be respected etc, etc. Whatever our rituals are, they are a shroud on on our eyes. The shroud that doesn't allow us to see how human really work, that our perception is not discrete and the expressive power of art is something we should explore as a discipline of human interfaces.

C/C++ is one such interface. It is a written language that no civilization from the outer world will be able to decipher. I didn't research this idea to far, so I leave it to you. It is a formal interface with brackets, asterisks and letter combinations that convey some ideas and concepts. It brings the former poor language of assembly to a whole new level. The level of more toys to play with and *exchange*. Every language invented after it was adding or removing these toys for humans to play with, but they still have hard time to combine all programming languages into the garden of toys as a whole. The garden that you can explore with the rest of your senses (further that arithmetic and text processor units in your head) to see how things work, tear them apart, which toys go well together and which just don't belong. There should be right toy for the game. It is in our mindset. We use the toy that we've used to, learned the first and like opiate, it instills us with the knowledge that this is the best tool in the world, in your world, because everything else if perhaps just worse. The nostalgic feeling brings us emotions, knowledge and experience keeps us in a comfort zone. Egoism. We want to world to be the same. But while we were playing with our toys, it changed.

Many toys appeared and vanished. Patterns made some of us high. UML - the art erased out of drawing - made slave drivers happy. These were adopted ways to transmit the knowledge, format the culture, and narrow the communication down to the limited capabilities of any human put into the bloody cage of enterprise machine. Bloody doesn't mean we can escape it. It is just bloody. I see it as squashing the humans into the cubes of comfort zones and I am afraid of it. There is no progress outside the cells of enterprise organisms and these organisms are still mostly parasites hooked on resources that they are extracting from ecosystem and killing the planet by their exhaust. If you think that Google is good - take a look to the streets - if there is any litter around - how do you think - could people from this Enterprise remove this litter with their bare hands? I think they could. It is easy and even fun. But will they?

C/C++ is not a litter. It is a tool and a toy. The world had grown a lot, but the tool and the toy stayed the same. In these 40 years we've learned that we can only have juggle 7 things in our head at a time. We have only 60 hertz in out heads compared to 3Ghz of modern CPU. 7 things is the most that can survive through the neural network while signal passes from one domain (limited 3D area) through the whole volume of absolutely parallel processing unit. The amount of thing that we need to keep in mind is bytes, chars and pointers, even for string processing. And as a humans we operate with strings. Even bytes in our heads look like hexadecimal and we are still constantly ignoring this. We are continuing to invent rational logical abstractions - new toys - instead of switching off the conscious part of our brain and concentrate on the part that scans things. In the past 42 years we've upgraded our interface from reading to scanning and nobody noticed that. The older people still insist on reading books, going through lengthy letters in mailing lists, and lots of articles. But we've invented movies, animation, visual arts, demoscene. The last one appeared and vanished - it was a sudden ray of warm and bright light - an excitement that was impossible to rationalize and explain, and that gave a birth to a whole generation of game designers out there.

C/C++ is not a game. It is a legacy, a hack, a combination of mysterious symbols that make impossible things possible. This combination has expressive power and concepts that will survive a whole new generations from now on. You will still need an instrument to manipulate memory on low level. An instrument to control hardware with high level concepts. But it is not C/C++ that needs to be used for that, because it doesn't make it optional. C/C++ doesn't help you scan programs faster, read operations behind combinations of asterisks, symbols and brackets to fill the 7 slots in your head with something that makes sense. It doesn't instill me with a sense of confidence, because the code once already written may leak in different places.

Back in a days we were playing with reversing the software. You choose the entrypoint and then try to figure out what software does. Most of the time you had to work with assembly, follow the jumps and procedures, you were writing tools to help you deal with the complexity and automate the journey. The process didn't change since. What changed is that you don't need to think about memory allocations anymore, algorithms can tackle strings more efficiently than humans, so this slot is freed too. You can concentrate on your DNA handling logic, on algorithm, on final result that you need to achieve and this result will make sense for ordinary humans,  not for people with computer science camp behind. Python made this possible by providing this interface for humans when hardware allowed that. Python adapted itself to humans who now scan things instead of reading them. You don't need a whole usability discipline to note a small nifty things to make improvements like these, but when you have this whole new usability and ux buzzworld emerged, it is somehow wrong not to take an advantage of that. It is quite natural and right from the point of standard human specie, but wrong from the point of augmented human that needs tools to be evolved to allow more freedom. Evolution in Python led to the Zen of it. It is not a speccy, not a book, not a long text in a foreign language. It is an artpiece - a thing that could only be born among people who value the artpiece of Monty Python, and appreciate irrational culture of humans and play that. Without the art squeaky PyPI will be remove and the new warehouse will be built, welcome sign will be replaced with patent paranoia, you will have to sign a paper and undergo passport scan to pass through. People attempt to save things that are important to them if they can see them. You can't see the irrational, you can't explain it, especially things that came naturally. Humans are limited in understanding things, in expressing things, complex associations and irrational thoughts that came out of their emotions, knowledge, fears and beliefs. They are limited in their ability to share this information with others, they don't have time to pass info anymore, can't communicate so fast and this is where the progress stops. Humans are limited, they can not deal with the complexity, and they naturally developed arts to deal with that. Arts communicate on different levels of perception and education, they are waiting for you to get there to feel them or came down on you rapidly right away. It is a way to look for answers, to explore, express and communicate them. It is about at least some kind of freedom in dealing with paralysis of complexity. But this is about C/C++ and I need to finish this.

C/C++ is insecurity, but at the same time it brings trust and freedom. At least it was many years ago. It is the last piece of freedom that makes hacking of the systems possible. It was fun and you don't want to kill the fun once you're there. It is not hackers, it is humans, sometimes among them, who kill the fun. Paranoia, fear, social engineering techniques that make talented hackers kill themselves. It is not fun anymore to hack things in this world of fight of limited species over limited resource. Perhaps the backdoor needs to close. I feel deep sadness and sorrow by thinking about that, but who cares anyway. There is a huge demand for a better readable human interfaces for controlling new technologies and devices that will be born to augment humans and while we are messing with bytes and pointers leaning of some memory scattered over the table, we skip the cosmos of possibilities and things that shine in depths behind our necks. There is a place for better coupling between human intention to care or not care about low level details, better interface between the though to operate on some level and the tools that make the thoughts real. It is important to keep it human oriented, because the picture that one human drawn should be intuitive and clean for other human to comprehend. If that second human is familiar with concepts, it should not undergo the long training in decyphering glyphs just to get into details. We've already seen that this is possible. Just need to experiment with this a little bit more to pave our way in the way art does it. Art is the ultimate hack of all times after the science.

And for us, for new generation of coders, C/C++ must die to let evolution continue.

Saturday, April 20, 2013

Program config as a DNA strand

This is a technical followup to the post about mind-altering programming languages, which concentrates, iterates and extends on the abstract DNA part.

Do you know how DNA looks like from the point of view of Python programmer?
DNA is a list. Of genes, and fillers in between.

    [ GENE, GENE, GENE, None, GENE, STUFF, GENE, .... ]

By the analogy with software, one GENE is one option. Here None or STUFF is something that is not recognized and not used in the process right now, but may be used later even in a different place for a different purpose. This leads to very interesting properties of configuration described as a DNA strand.

Property One: Everything is Optional and Configurable

Usually it is a tough choice what to include into your program config, because an option a day keeps users away. But with DNA config it doesn't matter - you can encode everything - every bit of flexibility you wanted, every feature-creeper, forward-thinking matter. Don't bother yourself with restrictions - include everything.

Property Two: Indefinite Logical Groups and Namespaces

To make sense out of tons of information in a DNA strand, you need to concentrate only on the parts that are relevant to you. This is done by "masking" (or marking) parts of the DNA code according to your current task. When you apply a mask, all GENEs of DNA that are not used are cleared. You can have multiple masks for different programs. An awesome feature-creeper would be to figure out mask automatically during the program run (program explicitly marks sequences what it reads and what it skips).

Property Three: Non-linear Option Identification

Because DNA is a list, you may think that you need to know option position to access it. This is not necessary. Index in a DNA is the most straightforward way to lookup an option value, and mask is a tool to help explore and identify its position. But the true power comes from the fact that a option can be identified by just analyzing content. Option can be a single GENE in specific format, or it can be identified as a sequence of GENEs that pass some validation logic. This makes is possible to write generic configuration analyzers, which can read these sequences to detect configuration problems, patterns and meaningful values to produce nice visualization out of them.

Property Four: Application Types

In real world™ DNA is packed in chromosomes. Humans have 46. Potatoes possess 48. Zombies are somewhere in between. In a virtual world of coding it makes sense to use one chromosome per application type. For example, every Python web framework has a lot of common parts, common features and minor details in these features, so a variety of such frameworks can be encoded with a single DNA strand.

Exercise

It may sound too abstract, but try to think how to build a shared DNA strand for two or more mini web application frameworks in Python. Just remember that DNA code includes both hardcoded application features and modifiable configuration options. And as usual look at BoxCar 2D for an inspiration.

Friday, March 15, 2013

Programming languages that alter your mind

Today I went to Perl 6 site.
I left.
I can remember in details what brought me there.
I still shocked by the new world that opened before me.
Butterflies..

---


NOTE: This is a not very positive post `about life`. Don't waste you time if you don't like such stuff.

The text below contains depictions of deaths by coding, too much letters, biased speculations, insight into psychedelic culture and a long way to the conclusions you're may not be ready to face with. You've been warned.


---

Let's face it - programming languages alter your mind. They affect the way people think and solve problems. It creates problems in life and relationships. Languages are addictive, they provide a lot of fun to entertain one's brain well beyond solving simple crosswords and moving sprites of monsters on the screen through the means of other sprites guided by the mouse-type manipulator. And while programming languages are fun, they are also harmful and even toxic.

A language is toxic when it doesn't match your expectations, such as were mine that resulted in filling Python bug #17426 (which I called the subzero wart, but that doesn't really matter). A language is harmful when it requires you to remember yet another thing from its "funny" behavior, and for that purpose you need to sacrifice a mem cell that was dedicated to store the name of your girlfriend's favorite flowers. It is harmful if it affects your mood, and you get butthurt when you read bad things about it.

---

Programming can be fatal for a girlfriend, relatives and the person in general. Much like eating mushrooms. I was only at two funerals of people below the age of 25. Both of them died of pneumonia, because both were not attentive enough to the symptoms of the cold they got, and that's because their attention was completely absorbed by tasks they needed to complete for their jobs. Their body failed, because their brain was unable to dedicated resources to timely response to the alerts of life sustaining system.

That's why people quit programming. That's why salaries are so high. But that doesn't mean other jobs are not harmful either. Low salary can be much more harmful in many ways leading to low self esteem and to even more complicated problems with relatives, friends and society. Did I say mushrooms can do this too?

---

Programming can be fatal even for the people with positive strong attitudes to pursue their own goals in life. If taken without prescription or without negative sides of the daily jobs in bad companies, programming becomes addictive - fun for one who practices and a loss for the human society. Ignoring everything around, being busy with developing your own _____ (framework, game, startup, social network, ...). A loss that happens when a person is leaves the job to pursue its virtual dreams about programming. Dreams disconnected from reality. And reality is something that you've completely ignored and skipped while being buried under the pile of daily tasks at your big corporation. Did I say that mushrooms can cause this too?

---

Real life is tough. It requires interaction with people, responding to signals and basically you start to forget your ideas, dreams and become more far away from your goals. New ideas are less likely to visit you, because maintaining a business requires a mindset of a library with shallow functions, not a scientific library with modelling algorithms. Maintaining a business is reinventing the bicycle. Over and over, day after day. Pursuing your dreams is reinventing the bicycle. Over and over, day after day. That keeps people busy, and the progress slow.

Programming languages can make the world less harmful and more close to the reality. Programming languages that are accessible, that save time and don't have a tough legacy. Enabling people to adapt them, discuss them and invent their own. If people can not invent ideal programming languages by themselves, by calculating, by using maths and inductive reasoning - they should try genetic algorithms. Did I mention that mushrooms can mutate?

---


The more experience I gain, the less I want to learn the peculiarities and differences between the languages. I just want them to work and I'd gladly outsource the task of inventing such working language to genetic algorithm. Algorithm where I involved as a social actor that makes selection based on shared experience with other actors. Genetic algorithm is where you have a set of parameters written into one long line. Mutation is a change of some or all of these parameters - sometimes completely random, sometimes guided. If your programming language has parameters - syntax, functions, modules, features - you can describe it using this long line called DNA.

To apply genetic algorithm you need a selection method - this is a shared user experience. You need an identification for the language a DNA sequence, but also a registry of names for and versions for human consumption. You need to abandon backward compatibility excuses and start building reusable components that will become new parameters in the language DNA sequence.

---

It starts to get late. Tomorrow there will be a new day, new karma and new ideas, so I need to finish this today. If programming languages can alter you mind, you can use this mind to alter the language. It is well known that when you look into the abyss, the abyss also gazes into you, but it is less known that it is an iterative process. Did I mention that shrooms can give you powers?..

Let me say goodbye and wish you all the best, dear reader. I hope you had a good trip, and now enjoy the expanded state of your mind and consciousness. Did I mention mushrooms? Right.

Sunday, October 21, 2007

Wanted: Language Transition Function Matrix

The scary name doesn't follow any complicated topic from linear algebra. It merely outlines an idea of a tool for PHP to Java to Python person who wants to get a familiar API on whatever platform the work needs to be done at the moment.

Organized as a snippets repository in matrix form (ok, let's put 'table' for 'matrix') it could conveniently display snippets in a target language that serve as an analogue of functions of a source language. For example, PHP function string file_get_contents($filename) is presented in Python as a :

def file_get_contents(filename):
f = open(filename)
try:
r = f.read( )
finally:
f.close( )
return r

Hovering the PHP API function name could popup a small DHTLM window with function description and a link to official documentation. Main link outside the popup area leads to user content. The resource is a collaborative area that reflects the state of language mappings between different language APIs, allows users to submit their own versions, vote, comment, refactor comments and narrow the scope of original API. It could also allow to work out and point best practices of using languages in specific areas.

I do not know of any resource like this one yet.