SyntaxDB – Quickly look up syntax for programming languages
syntaxdb.com
syntaxdb.com
I think a transpiler would be absolutely awesome -- even if it only works on curated code samples on the site. Something that shows how a piece of code can be expressed in many different languages. This would be extremely useful for things like Regular Expressions (also, no results found for regular expressions on the site), which are in just about every language, but are treated very differently.
Personally, I think that's your killer idea. It will be damn hard to do, but if you can make it work, I think you'll end up with a lot of visitors. Knowing the language idioms is key to understanding a language.
A syntax database is not terribly useful. A concept database is where the real value is. The idea is that a language is much more than just raw syntax. C++, Python, and awk are all so fundamentally different that explaining the differences in terms of syntax is ultimately worthless.
Even something like "array in C++" vs. "arrays in python" is not very valuable because they really mean totally different things. There's a lot of unknown-unknowns for a Python programmer whose never seen C++ code in their life. They would never think that arrays are fixed length and accept only one data type because lists in Python have neither limitation, likewise, a C++ programmer might be looking something to that behaves like std::vector not understanding that Python lists are perfectly appropriate.
It would be perfectly acceptable to have people write the "same" (ideally, non-trivial) code in different languages and link them together. In fact, that's probably what they should seek to do.
A lot of responses will be about "there's no result for x". You're right, there isn't nearly as much content on the site as I'd like there to be!
The content is actually hand written, and as of right now focuses on the very basic programming fundamentals common across all of the languages. The plan is to triple the amount of content in the database (adding DS, special classes, parsing, etc.), and eventually open up the database to outside contributions.
Additional languages are coming too!
Not sure how you're doing the querying but when I dropped the "smart" from "C++ smart pointers" it did return a result. Does every word in the search have to match then? I'd have thought, similar to Google, that it would return results where at least some of the search keywords matched even if they all don't.
Anyway, it looks like a good start. Even for people who already know a lot about programming it should be really useful for those times when you know what you need but just can't quite remember the full syntax of something.
Love the idea!
With that being said, I think the current integrations and the ones planned ahead will continue to make SyntaxDB a good option, even if other sites try a similar idea.
``` In [1]: s = {}; type(s) Out[1]: dict ```
I guess I didn't account the specific "foreach" keyword with C# (I have it as "for each"), good catch!
Does anybody remember what that project was? Does it still exist?
Slightly OT, sorry. This project just reminded me of it.
We support Go and Java now. More languages are coming soon (JavaScript, Python, etc.).
SyntaxDB is super cool, BTW.
Definitely would use Sourcegraph with Python support.
I'm not sure if I have a good idea here or not, but focusing on older and/or more esoteric languages is a potential niche. For instance, and these are real examples, maybe I've inherited some SAS code with a nasty DATA step and I don't really know how a MERGE works. Or COBOL. I always have ridiculous COBOL things to google.
As someone else pointed out, though, I think you need some cross-search between idioms. I might not know what a SAS DATA MERGE is, but if I look for a SAS join, tell me how to do it in PROC SQL or the DATA step.
Keep going, I think this is very cool.
I wish it was more complete though!
"No results found for bash if" https://syntaxdb.com/reference/search?utf8=%E2%9C%93&search=...
I don't have to look for long to find inaccurate statements, e.g. the page that describes "for of" in ecma states that order is not guaranteed, when the order of an `of` is however the iterator is defined for that collection. e.g. `for (const a of (function*() { yield 1; yield 2; })())` is certainly going to have an order. I think they were just confusing it with for in.
Just sayin. Frankly I like how it's not Wikipedianishly drowning in citations and/or demands for same -- but how does it get updated? I immediately tried to expand on those two issues I mentioned but there was no sort of UX recourse for my pedantic urges (FWIW)
It'll later be open for others to provide new concepts and corrections.
I think there is still a lot of improvement possible for the help that the editor (plus tools) can offer. Much more (and more intelligent !) help and info to be shown while I type or move around in code. At the very least instantly show parameter types plus full docs on every function my cursor is on. Visual Code does a good job with the Go plugin but it could be faster. And there is only so much a plugin can do.
If AI is really the future of coding then it least at some point it should be more helpful before it takes over...
do notation in haskell
with python
function pointer c foreach python objective-c blocks
blocks in objective-cI also need to improve the search engine to handle queries with additional words that might give a null result, as well as words like "foreach" (that has to do with the database). This will be fixed very soon.
It is bad that there are missing concepts, and I'm fully aware that this isn't even close to complete. The goal in the future is to have as few null result queries as possible. I actually make note of queries that don't provide results so I'm glad everyone's making these known, it'll only make the database better in the future!
https://syntaxdb.com/reference/search?utf8=%E2%9C%93&search=...
For example, the for in Python should include an example using enumerate too which I'd be happy to add and contain some additional docs on xrange vs range in Python 2 vs Python 3.
* "channels in go" (no result)
* "mutex"(no result)
* "generator in python" (returned a page describing the Python programming language)
Feature suggestions:
- include the code-highlighted syntax block in the typeahead suggestions. - When i hit 'enter' on a typeahead suggestion, send the user to the page instead of just filling the input.
I'd recommend const pointers, maybe function pointers, arrays of function pointers.
For JS, I'd recommend instanceof.
"for loop in bash" no results :-(