5 ms·
I'm working on a language optimized for solving programming challenges as quickly as possible. That is, I'm not optimizing for execution time, I'm optimizing f
by nemo1618 6y ago
I'm working on a language optimized for solving programming challenges as quickly as possible.
That is, I'm not optimizing for execution time, I'm optimizing for time between reading the problem statement and having a working solution. As far as I'm aware, there aren't any existing languages in this space. There are plenty of "code golf" languages, which optimize for shortest finished program, but that's slightly different. Based on the top AoC solvers, the closest thing today is Python -- but we can do so much better!
Currently, the language is very immature, but it can solve a handful of AoC problems. But before long, I'll need to tackle a very big problem: building an IDE around this thing. See, for a language like this, the syntax is only half the battle. Ideally, when I type something like `| map (*2)`, I should have instant visual feedback showing me how the input is affected by this change. Not to mention more traditional IDE features, like suggesting functions based on the type under the cursor.
I don't have anything public to share yet, but if you're interested in collaborating (esp. on the IDE), feel free to shoot me an email.
- nemo1618 6y agoOh, another side project I'm working on: a "high touch" music recommendation service. Like Pandora, except your recommendations are chosen by a real person instead of an algorithm. Downside: you get far, far fewer recommendations; upside: you can tell your recommender exactly what you want, exactly what you did or didn't like about a track, etc. Beta-testing it with some friends and family now; we'll see if it grows into anything real!
- maxwelldone 6y agoThis sounds very cool. I recently thought of another approach for song recommendation due to necessity i.e.: based on how a song sounds. There are genres but they're way too generic. Other methods like similar artists, what else people who've likes a song love etc doesn't always work. Not sure how streaming services recommend but I don't think they do what I want. I know, how something _sounds_ is subjective but I was thinking something along the lines of how Shazam app does. If they can compute a song signature and compare it against a library, it should be possible(?) to find top 10 closest neighbors. BTW, I'd love to test your app if that's possible.
- jamespwilliams 6y agoIs the code for this available somewhere to look at?
- nemo1618 6y agoNot yet, but once it's capable of solving most AoC problems, I'll throw it on GitHub and ping you!
- fgimenez 6y agoThis is such a cool idea. The gap between the "aha" moment of a programming challenge and the implementation is high for me since I don't get to code very much anymore. Can't wait to check it out!
- Areading314 6y agoYes, agreed. I recently went through AOC2020 and found that much of the actual implementation was actually quite a chore, even though many of the problems seemed quite simple. Granted I was using C++: https://github.com/areading314/adventOfCode2020 https://github.com/areading314/adventOfCode2020
- furyofantares 6y ago> I should have instant visual feedback showing me how the input is affected by this change Like LightTable? Might want to check that out if you're not already aware of it. I don't know if it's gone anywhere in recent years or has inspired any similar features in other editors.
- nemo1618 6y agoAh, I remember when LightTable launched -- my dad (huge Clojure fan) was over the moon. Even today he's still trying to convince me that I should just use Clojure. :P
- jzelinskie 6y agoHave you given any thought to this being used in place of pseudocode in white papers? If the language is much easier to translate problem into code, it is probably good at conveying ideas for documentation or teaching. My naive assumption is that would be a more useful focus than IDE tooling.
- nemo1618 6y agoThat's an interesting idea, but I think it wouldn't be a great fit. Reason being that, in the interest of speed, the language will need to include some irregular or unintuitive syntax and idioms. It goes without saying that pseudocode shouldn't require a manual!
- eyelidlessness 6y agoI hope this will in no way be interpreted as discouraging or snobbish, just want to add a little perspective. Please understand that I’m very supportive of your endeavor... > As far as I'm aware, there aren't any existing languages in this space. In some form or another, all existing languages (other than joke langs) are in this space. That’s why we have programming languages. Ultimately they all prioritize some subset of “problems” that they optimize solving. That said, in terms of instant feedback I’d look at LightTable and (believe it or not) Chrome dev tools as prior art.
- nemo1618 6y ago> Ultimately they all prioritize some subset of “problems” that they optimize solving. Sure...but not solving quickly, at the expense of all else. Rust is optimized for solving certain problems -- but solving them robustly, not quickly. Python comes a bit closer, but Python also wants to be readable; I don't have to worry about that. I guess one way to frame it is: the core values (https://vimeo.com/230142234 https://vimeo.com/230142234) of this language are velocity, and...that's it. Maybe expressiveness (less typing) and transparency (immediate feedback), but really those are just aids to velocity moreso than orthogonal values.
- eyelidlessness 6y ago> Sure...but not solving quickly, at the expense of all else. I really, sincerely, think they do. It’s just that their optimizations focus on the subset of problems. For example: > Rust is optimized for solving certain problems -- but solving them robustly, not quickly. This is basically the same thing as saying: when the problem one wants to solve quickly is robustness, Rust may be a good choice. > Python comes a bit closer, but Python also wants to be readable; I don't have to worry about that. There are some problems I associate with quickly solving in Python, and others where I find it exceptionally slow. Sure, readability may be a contributing factor. Another is immature/complex tooling that makes static validation or dependency management a slog. Another still is that a lot of its concurrency story is in flux and you have to spend time researching approach and compatibility if your problems are concurrency related. I’m still not trying to discourage, but I’ve spent most of my career working in scripting languages (those which most prioritize “rapid prototyping” and “repl driven development”), and ultimately when they’re applied to use cases that they’re not designed for their velocity is consumed by tooling. My advice, intended with kindness and encouragement, is to consider which problems you wish your language to be able to solve rapidly. To your points about velocity aids, expressiveness and transparency aren’t just velocity amplifiers at the time you write code. They also (can) aid velocity of reading comprehension, editing/refactoring, review. This is a place where Python does very well in terms of velocity: even when I had read less than 100 lines of it, I could generally review work and ask important questions about what it was doing in... well, frankly a shorter time than the JS I was actively working with as a lead at the time. It’s clear you want a language that enables devs to dev fast. But what are they doing fast?
- jokethrowaway 6y agoOne idea I started building and never finished was "pseudocode as code". The idea was to have a compiler for pseudocode used in CS books in place of real code. There are a few small differences (eg. using = vs :=) but most books and interview-preparing materials use a C-like notation. Then I started reading papers written by language researchers (which use haskell-like pseudocode) and realised the size of the task at hand. Probably trying to please only CS students / people doing interviews would still make for a fun hack.
- Bostonian 6y agoI remember looking at a textbook for scientific computing, seeing what I thought was pseudocode, and later learning it was Julia.
- Areading314 6y agoI'm also very interested in this problem. Have you explored other paradigms to specify the program outside of text?
- nemo1618 6y agoAs in, visual programming? I don't have a ton of experience with that, but my gut says that once the problems reach a certain degree of complexity, it would hurt more than help. Or, how about vocal programming? I wonder if, in practice, dictation might be faster than typing? :)
- Areading314 6y agoYes, recently I've been interested in visual programming paradigms like scratch. After all Python was originally supposed to be a teaching language. Maybe in 2030 the newest generations will find text files archaic and not expressive compared to new types of visual, vocal, or even "video" animated languages.
- paulclinger 6y agoI have done something similar in a Lua IDE: http://notebook.kulchenko.com/zerobrane/live-coding-in-lua-bret-victor-style http://notebook.kulchenko.com/zerobrane/live-coding-in-lua-b.... The IDE actually supports live coding with several Lua toolkits (Love2d, Moai, Gideros, and others; here is an example with Love2d: http://notebook.kulchenko.com/zerobrane/live-coding-with-love http://notebook.kulchenko.com/zerobrane/live-coding-with-lov...
- andeee23 6y agoFor the IDE part, you can look into the Language Server Protocol spec and write an implementation for your language. Would then work with most editors like VS code, vim, etc. out of the box and remove the leg-work of making the rest of the editor.
- qixxiq 6y agoI've worked on a few similar projects, and in this case I'd recommend trying to write your syntax however you want, but implementing it as a transpiler to Python. That way you always have access to the Python libraries, for competitions where you need to show your code it'll be easier, and there are already a lot of optimisations. That said if you're primarily doing this for fun- go wild with the implementation.
- hacker_9 6y agoSQL anyone? High level language, immediate feedback mostly, does the low level optimisation for you, you can performance tune with indices where needed... :)
- maest 6y agoYou should have a look at q/kdb. Once you get comfortable with the language, you can write some very complex code very quickly - part of the reason is the compactness of the language, but also due to the functional, loop-free style which uses the right primitives.
- spark3k 6y agoIs there a way to follow your progress?
- yrwiovhd02 6y agoThere is actually a community of ~20000 people using some forms of this: codeforces.com. The most used approach are lots of macros in C++ to completely modify the language. One popular alternative is https://cpeditor.org/ https://cpeditor.org/. For example, look at how Benjamin Qi does it: https://codeforces.com/contest/1446/submission/98447974 https://codeforces.com/contest/1446/submission/98447974 The actual code is at the bottom. Here is a sample of a submission to a problem harder than your usual AoC second part: int main() { setIO(); re(N,M); str A,B; re(A,B); F0R(i,N+2) F0R(j,M+2) mx[i][j] = -MOD; int ans = 0; R0F(i,N) R0F(j,M) { ckmax(mx[i][j],mx[i+1][j]); ckmax(mx[i][j],mx[i][j+1]); if (A[i] == B[j]) { dp[i][j] = 2; ckmax(dp[i][j],mx[i+1][j+1]+4+i+j); ckmax(mx[i][j],dp[i][j]-i-j); ckmax(ans,dp[i][j]); } } ps(ans); }