Hi Calvin, On Sat, Oct 2, 2021 at 9:31 AM Calvin Irby <calvin.irb...@gmail.com> wrote: > > Hello Link Grammar Community, > > I was just wondering about how the way that Link Grammar is written. I know > over time it has changed a lot and various support for other languages have > been added. But why was Link Grammar written in C?
Because neither Python nor Java existed when link Grammar was created -- version 1.0 came out in 1991, so it's celebrating it's 30th anniversary, now. > Is it because C is fast and so natural language processing requires the C > language so that calculations are done as fast as possible. If that's the > case, where would that leave other high level languages? Could Link Grammar > ever be rewritten in a language like Python? Yes it could be. Any system can be rewritten in any (Turing complete) language whatsoever. Most programming languages are Turing complete, the few exceptions are explicitly not: regex's are for finite state machines, only. For the link parser, Python would be a low-quality choice. For two reasons. (1) good god, why? The code already exists, it's debugged, it works. (2) it would be 10x or 20x slower. Many of the structures inside of LG are hand-tuned to fit inside the cache-line of a typical modern CPU, and a fair chunk of it's performance comes from this kind of tuning. This tuning is (literally) impossible in Python and java. (3) If you do want to create something new, well -- I'm developing a theory and an infrastructure that is Link-Grammar-like, but is more general: I believe it will work for audio and video (and other things, too) but the parser will remain very link-grammar-like. See the README's in https://github.com/opencog/learn and the documentation in https://github.com/opencog/atomspace/sheaf for more details. > It just seems like High Level Languages like Java and Python make it > difficult because developers never seem to learn all of the language and are > always fighting an uphill battle just trying to understand all of a > language's ecosystem. Python is the Visual Basic of the 21st century. A lot of people who don't know how to program, who are terrible programmers, write code in Python. It's OK to keep them at arm's length. The Java infrastructure is daunting. There are practical issues: requiring 16GB of RAM for infrastructure just to write and run "hello world" is more than I can handle. I spent years coding in java, and came to dislike it. It's very verbose -- you have to write 5-10 lines of code to do just the simplest things. Much much more important is the theory: It is very difficult to write abstract, recursive algorithms in Java. The entire idea of object-orientation fights against the idea of recursive data structures. Things like Link Grammar, and the AtomSpace are all about recursive data structures. It would be miserable to have to work with these in Java. It's like .. I dunno, wearing pants for a shirt. Wearing a shirt for pants. Shirts and pants are great, but you have to wear them on the correct part of your body. The shape of recursive data structures simply does not fit conventional OO languages - not just Java, but also javascript, (although that is for a very different reason, having to do with named data structure locations, as opposed to anonymous ones.) This is why most of my code is in Scheme, these days. It's not because Scheme is a great language. Actually, it kind of sucks - it's hard to use, hard to understand, difficult to read, difficult to modify. But it fits the data structures much much better. ***For this particular project*** (and not other projects!) one line of Scheme does more than 20 lines of contorted, complexticated Java or Python boilerplate. It's all about the data structure. > Not only that, but my predictions is that the C language is a safe bet now > for most projects as AI and ML techniques will soon be taking over the > development world. We are already seeing a movement for "No code" and Tim O' > Reilly even commented recently that "The Golden Age of the Programmer is > over". Is C going to be the surviving dinosaur language that will continue to > thrive in the future while all the other various high level languages die out > to the technologies that big corporations are developing? Google and > Microsoft seem to be on a race to develop AI that helps out developers. You're talking about developers who are inexperienced -- the "Visual Basic" kind of thinkers -- the "Power Users". The people who were crappy programmers to begin with. Sure, AI will allow them to evolve into better crappy programmers, or not be programmers at all. -- Linas -- Patrick: Are they laughing at us? Sponge Bob: No, Patrick, they are laughing next to us. -- You received this message because you are subscribed to the Google Groups "opencog" group. To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/CAHrUA36Pa39%3D-56sjqPdD2OxoP7R800rxrz%3DwK_%3DuDEtMYV%3DWQ%40mail.gmail.com.