I have fallen in love with this language. How I do replace Java(Script) with this?
Stages of denial in encountering K
141–150 of 432 posts
Re: Stages of denial in encountering K
#142Earlier quoted context omitted.
Boilerplate can be stripped away, though, while you can't pull meaning out of a symbol without knowing what the symbol is .
Sure you can — from repeated usage of said symbol in context. That’s how language acquisition works in toddlers. Not saying that it’s a preferred way, though.
Re: Stages of denial in encountering K
#143Earlier quoted context omitted.
If people don't know a language, yet find it readable, they are more likely to end up getting involved in doing those things. Poor readability is not a good way to keep people out; you're not selecting for talent.
You're overestimating how readable any programming language is to non-programmers.
Re: Stages of denial in encountering K
#144Re: Stages of denial in encountering K
#145Earlier quoted context omitted.
A bit more convincing: http://www.kparc.com/edit.k Properly formatted and with comments, it almost looks readable. The insistence to use one- or two-letter identifiers that you then have to look up the meaning of in a comment makes it look pretty childish, though. "Look ma, it's still super terse even when doing something real!" Yes kid, it is when you refuse to do the one obvious thing that could actually make it re…
Single-letter identifiers are a natural thing to object to when coming from other language paradigms, i.e. nearly every programming background out there, but this is a category error. What seems ridiculous in one context can be sensible in another. The objection turns out to be parochial. It reminds me of how people think that parentheses are a significant aspect of Lisp, when in practice they're not. The parens look…
I wrote plenty of J code for my masters in particle physics and the only way I could use it without going insane was to write a noweb filter for literate programming when using latex symbols for the functions. The woven document was close to mathematics, the actual source code was editable source code.
Re: Stages of denial in encountering K
#146A million-line program isn't readable by anybody, no matter how readable the language is. If the equivalent program can be written in, say, a thousand lines in some more concise language, that's more than worth the learning curve, even if the language is strange and off-putting.
Re: Stages of denial in encountering K
#147Earlier quoted context omitted.
I think a random high school student who has just finished AP Computer Science should be able to read my Swift, at least when the task itself is not complicated. Maybe not all of it, but I think it's a failure if they can't get the gist of it. (Interesting anecdote: I have gotten emails from people who have translated some of my Swift code which talked to an API endpoint I reverse-engineered to their platform of choi…
You added more criteria to this high school student. Almost every one of them will have to use and program spreadsheets, few learn to program using an ALGOL-like language. The idea you put forth disqualifies any programming language that isn't derivative of ALGOL: it's exactly the sort of thing used against Lisp dialects, and many other languages that have shown themselves to be quite wonderful ("What's cdr? That's s…
Re: Stages of denial in encountering K
#148what is this orange website the post mentions?
Re: Stages of denial in encountering K
#149Earlier quoted context omitted.
If the language allows you to simplify the program sufficiently it might be easier to just rewrite it from scratch when the requirements change. I doubt that this is the case for any language, but you know, in principle it could happen.
https://en.wikipedia.org/wiki/Write-only_language >Languages that are often derided as write-only include APL, Dynamic debugging technique (DDT), Perl,[2] Forth, Text Editor and Corrector (TECO),[3] Mathematica, IGOR Pro and regular expression syntax used in various languages.
As a thought experiment, would there be benefit to letting functions only be written once?
No-one could come along and break code by changing a function. If you wanted to fix a bug in a function you would have to write a new copy and explicitly update callers to use the new version.
A lot of maintenance overhead? Possibly, but tooling would take care of the majority of it. It would be useful to be explicitly know not just when a function has changed but when the functions it calls have changed.
You would need a naming convention, instead of Main you would need something like Main#23145. It would tick over very regularly.
Library functions like CalculateTax#12 would tick over less frequently.
By calling the old revision you could call the old code if you didn't want to update a module or function.
Perhaps you could extend that name to be something like Namespace.Name#IndirectRevision.DirectRevision.Hash which would allow tools to more quickly extract when the change was made in the logic of the function itself or when the change was in dependents.
This would be an alternative strategy to maintenance to IoC. Instead of treating dependents like they don't affect the code being executed, we can control instead the version of code
By forcing code change in all callers, you build up an explicit picture of where bugs happen but more important see also at the impact of those bugs on other places.
It would need great tooling to get over the paradigm shift of moving away from IoC but I think it would be interesting.
Re: Stages of denial in encountering K
#150A million-line program isn't readable by anybody, no matter how readable the language is. If the equivalent program can be written in, say, a thousand lines in some more concise language, that's more than worth the learning curve, even if the language is strange and off-putting.
Chrome is well north of a million lines. Anyone familiar with C/C++ can at least meaningfully explore the codebase with the use of mechanisms like ctags and understand parts of it. If it were 1/1000 lines fewer but in K instead, I don't really think that would make grokking it any easier.