1. 7

In a new language I am working on instead of writing one word links like <a href=“https://example.com">this&lt;/a> you write links like this🕸example.com.

[word]🕸[url]

It compiles to an a tag. HTTPS is assumed.

Anything wrong with this? Which emoji should I use?

  1. 16

    I think there’s an XY problem here. What’s the purpose of doing this? Is it because writing <a href> </a> is too much overhead to write? Too much overhead to read? Is “links can only be one word” a technical limitation, or a design goal?

    1. 2

      It’s for a 2D language. 2D langs work better when words are atomic. Matched delimiters (like parens, brackets, tags) are an anti-pattern in 2D langs. You gain a lot of nifty little features when you know words are atomic.

      1. 9

        Can you link to a resource that explains what you mean? I’m not familiar with 2D languages, but it sounds like you’re still using delimiters, they’re just white space instead?

        1. 1

          I have no idea how the listed syntax is associated with a 2D language, but https://en.wikipedia.org/wiki/Befunge is an example of a 2 dimensional language.

    2. 12

      This seems much more trouble than it’s worth, for the reasons already described. Sorry, I like emoji but I’d never use this.

      In general I’d much prefer developers use Markdown than make up yet another syntax. New syntax is more work to learn, requires new code for any tool that wants to parse or generate it, and wastes all the nice tooling and infrastructure built up around Markdown.

      1. 7

        how do you make a link from multiple words? Or from other elements (like an image)? How do you link other pages with relative paths? Also, requiring an emoji to write something is a major PITA.

        1. 1

          Or from other elements (like an image)?

          An image with a link could be something like 📷foo.gif🕸foo.html For other elements, you’d have to fallback to tags.

          how do you make a link from multiple words?

          Good question. I think this will only be for the case of one word links. That might have interesting (intended) second order effects. Encouraging people to write human language like they would computerLanguage.

          How do you link other pages with relative paths?

          This is a good one I just ran into. Not sure. Maybe double web biography🕸🕸about.html

          Also, requiring an emoji to write something is a major PITA.

          The trajectory is ease is getting steep, so I don’t see it being a PITA in a few years. That being said, this would be optional. You can always fallback to tags.

          This was all very helpful feedback! Thank you!

          1. 2

            If you can fall back to tags, doesn’t that mean you need to know that tags are there, and so the nifty features you say in another comment that you gain by dropping matched delimiters are lost?

            Using camelCase is an interesting side effect, but why do you intend that? How is it beneficial? Could that prove to be an accessibility concern?

            However easy it becomes to write emojis in a year or so, it’s unlikely to be any less easy to write the characters necessary for markdown or html, and people know those. That’s just one less thing.

            Using emojis it seems like you’re trying to make things easier, more intuitive, or more friendly. But there are a lot of similar emojis, or ones that could go in the same place. The camera emoji or the photo emoji? The web emoji or the globe emoji?

            It’s a cool idea, but not sure it’s practical.

            Oh also, in terms of relative paths, is another syntax really necessary? Why not just let someone put whatever they want and let the browser resolve it as a relative or absolute path? That’d require putting http:// at the start of absolute paths, but that’s standard practice.

            1. 1

              Why not just let someone put whatever they want and let the browser resolve it as a relative or absolute path?

              I went with link🔗./about.html for relative paths for now.

              so the nifty features you say in another comment that you gain by dropping matched delimiters are lost?

              It’s a probabilisitic thing. So you are encouraged to use 🔗, and if you do you can get nifty features, but if you are landing a rocket on mars you don’t want to depend on them.

              Using camelCase is an interesting side effect, but why do you intend that? How is it beneficial?

              I prefer camelCase to other_case systems, but really the important thing is to get people to agree on a token for a concept, like Wikipedia.

              But there are a lot of similar emojis, or ones that could go in the same place.

              This is a good point and could end up being a problem.

        2. 5

          It would take me longer to find and type the emoji than the actual HTML tag. I’m not sure it really helps in terms of readability?

          One idea to shorten the tag is to introduce a notion of default keys. For the tag, href is the default key. This would allow writing <a https://example.com>this</a>.

          1. 1

            Oh that’s an interesting idea. Perhaps even:

            this<example.com/>
            
            1. 2

              It really depends on what you are trying to achieve. Is typing links a major issue in HTML? Sugar is nice but usually writing speed is not the main bottleneck to production-ready code.

              1. 1

                Goal is to have a simple way of writing links that would fit in a single cell of a spreadsheet (so more 2D lang friendly).

          2. 4

            That emoji is tofu on my phone, probably is for many others, so that seems like a silly way to do it. Plus the inefficiency of emoji input methods will offset the character savings by a long shot.

            You might take inspiration from my typeup, which uses the format [link of many words https://skuz.xyz] (last word is URL, rest is text). It’s 2 characters of overhead and not limited to one-word links. You could reverse this, if you wish. For images, I’ve done the markdown thing of prefixing with !, and it works well.

            1. 2

              Very cool! I don’t know if I had seen your typeup before. I think your link format is much better than Markdown’s, which I always forget whether parens or brackets go first.

              On the tofu issue. I had no idea. It’s a web for me. Anyone know of a site that shows you what emojis look like on most machines? Is there a “web safe” emoji subset?

              1. 3

                AFAIK either the font includes emojis or it doesn’t, most people use a font with the full emoji set. Mostly, it should be fine, because people can just change some settings - adding Noto as a fallback will fix it all. But no-one wants to be told to change their settings just to view a text file. Oh, and the issues they could cause encoding-wise are not nice.

                Perhaps you’d find something decent in the core characters of Unicode?

                Anyone know of a site that shows you what emojis look like on most machines? Is there a “web safe” emoji subset?

                I know Emojipedia shows emojis in different common fonts if that’s what you’re looking for (there’s probably a million better alternatives).

            2. 4

              Surely 🔗? I.e. ‘link symbol’

              1. 1

                Yes, you’re right! Much better. Thanks! That’s what I went with in the release (https://scroll.publicdomaincompany.com/releaseNotes.html)

              2. 3

                Unorthodox approach. Might find fans but I doubt it will be a huge improvement over, for example, markdown does it. You might also want to check out markojs templates

                1. 3

                  I was surprised to see the web emoji here, that’s what I use to sign off my blog posts (my last name is Webb).

                  It’s an interesting concept but feels clunky. I don’t want to open the emoji picker in order to create a link.

                  1. 2

                    I like this approach.

                    🕸seems like a good symbol for a link.

                    Multiple words could be linked by underscores: hello_world🕸example.com

                    1. 5

                      There’s too many uses for linking that this wouldn’t work with, like linking the title of a talk, or a full name, or an academic reference.

                      1. 1

                        Why wouldn’t This_is_the_Title_of_this_Article🕸example.com/somearticle work?

                        1. 1

                          Fixing_Faults_in_C_and_Java_Source_Code:_Abbreviated_vs._Full-Word_Identifier_Names

                    2. 2

                      I think this is an interesting area to explore, you should be able whip up a prototype to test the ideas out with any regexp implementation that supports unicode.

                      This has overlap with the concept of structured editors, where the tool would be used to build a correct ast in memory, no parsing of text is required. Checkout nosyntax and futureofcoding they seem topical for you.

                      Maybe something like codemirror could be extended so it is easier to implement the emoji insertion.