Keeping the syntax and the need to memorise syntax simple

Something like this new language everyone’s talking about?

1 Like

You are very welcome to build the tools that you would like to have and make them available so that others in the community can use them if they find them useful.

As an example there is @Amin_Yahyaabadi’s https://github.com/aminya/juno-plus

3 Likes

Thanks for mentioning this.

I want to add that everyone is welcome to add code snippets to juno-plus and make a pull request. I will review and merge them. The snippets work in most of the IDEs.
https://github.com/aminya/juno-plus/tree/master/snippets

1 Like

Unless your goal is to start a team that is developing an AI driven IDE I think this might be beyond the scope of your OP. It sounds like you have a vision of the kind of syntax you want and I think you could accomplish a lot of this on your own with relative ease. Julia is really good at allowing users to develop their own language within Julia using macros.

You might want to start with something simple, like a macro for better dictionary construction. Once you figure out several pieces you can combine them and have something like

@syntax_heaven begin

dict3 = dict<string, int>( "a" : 1)

pop(dict3)

end

I’m not going to weigh in too much on whether or not any singe idea you’ve presented is good or bad because perhaps what you’ve envisioned as a whole is really neat but when presented abstractly like this is less compelling.

3 Likes

The request I put up here is not about me. It’s about what a lot of programmers face. You may have seen this video: Most Popular Programming Languages 1965 - 2019 - YouTube.
Yes, I would typically build the plugin. Currently already working on another open source project.
I guess for a start, Zach’s suggestion of using macro’s would work well.
The way we do programming is going to change soon. Whether it starts with Julia or some other language or IDE, it’s definitely going to change. It’s not a vision of mine. It’s being envisioned by many others already.

Sure — in a sense it is constantly changing. The way we program is very different from the 1960s, 1980s, or even the 2000s.

But keep in mind that people have been envisioning fundamental, major changes in how we program computers for a long time now. Very few of them happened the way it was predicted/envisioned.

(Incidentally, it would be better not to use the Internals & Design category for this kind of vague and speculative discussion.)

4 Likes

Most of the concerns that you raised relate to keyboard input issues, and I think many of them can be addressed at the editor or IDE level.

There is an Eclipse plugin for Julia:
https://marketplace.eclipse.org/content/juliadt

Frankly, I’ve only used Eclipse or NetBeans in the context of Java.

Recent development for a standard Julia editor/IDE has shifted away from Atom-based Juno to VSCode which has increasing popularity. See this Youtube video:

Emacs has the visual substitution feature. I found it cool when I first learned about it, but after two hours, reached the conclusion that I liked to see the bare text and not deal with yet another abstraction layer in my mental models.

  (global-prettify-symbols-mode 1)
  (defun bluerose-prettify-global ()
    (dolist (pretty-symbol
             '(
               ("->" . 8594)            ; → 
               ("=>" . 8658)            ; ⇒
               (">=" . ?≥)
               ("<=" . ?≤)          ;Might be bad with Scala.
               ;; (">=" . (?\s (Br . Bl) ?\s (Bc . Bc) ?≥))
               )) (push pretty-symbol prettify-symbols-alist)))
  (defun bluerose-prettify-lisp ()
    (bluerose-prettify-global)
    (dolist (pretty-symbol
             '(
               ;; ("lambda" . 955) ; λ
               ("reverse" . ?⮌)
               ;; ("->" . (?\s (Br . Bl) ?\s (Bc . Bc) ?🠊))
               ;; ("->>" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s
               ;;               (Bc . Br) ?🠊 (Bc . Bl) ?🠊))
               ("->" . (?- (Br . Bc) ?- (Br . Bc) ?>))
               ("->>" .  (?\s (Br . Bl) ?\s (Br . Bl) ?\s
                              (Bl . Bl) ?- (Bc . Br) ?- (Bc . Bc) ?>
                              (Bc . Bl) ?- (Br . Br) ?>))
               ;; ("apply" . ?👁)           ;Funny
               ("map" . 8614)           ; ↦
               )) (push pretty-symbol prettify-symbols-alist)))

  (add-hook 'clojure-mode-hook #'bluerose-prettify-lisp)
2 Likes

@mkitti: thank you. The mention of Eclipse always reminds me of Jason Fruit’s words “the word “Eclipse” in a programming context (or a literary one, for that matter) fills me with dread; in my mind, Eclipse is a pig strapped to a dog strapped to a whale.:slight_smile:
@NightMachinary: That’s cool, but yes, even I’d want to see the actual text. My suggestions were more along the lines of retaining familiar syntax across languages and having a smoother typing flow. Anyway, on a “prettify” note, there’s somebody who actually put symbols into d3.js code (var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);). See the d3_geo_cartesian function in this page.

Ahaha, I love this community. OP asks to use common parlance syntax, us Julians dream about using another uncommon syntax.

I share the love for (more) mathematical syntax. And I guess this (whole thread) really shows something about the Julian community.

To be clear about the mathematical syntax, unicode is fully accepted in Julia and we have a unicode entry mechanism using LaTeX names and tab completion:

julia> ϕ = π/6; cos(ϕ)
0.8660254037844387

julia> λ = 3
3

julia> τ = 2π
6.283185307179586

julia> τ/2
3.141592653589793

julia> for color ∈ ["red","blue","green"]
           println(color)
       end
red
blue
green

https://docs.julialang.org/en/v1/manual/unicode-input/

6 Likes

Thats cool!

PSA written: PSA: Julia is not at that stage of development anymore

22 Likes

I do like being able to use Unicode characters in Julia, however, I fail to see the point of using instead of in in Julia, especially for for loops (I think it makes a bit more sense for set operations).

I think everybody understands what in means, and how to enter it with their REPL or editor.
takes four characters to type even with the Julia REPL instead of 2.
It takes 3 bytes instead of just 2 in the file.

:man_shrugging:

6 Likes

In my opinion the major appeal of over in comes when negated. I rarely use it for loops, but I’m rather unconcerned about the extra bytes in the file or the extra characters to type.

6 Likes

I find the notion that angle brackets are objectively better here quite fanciful. This syntax has caused huge problems in languages that use it, e.g. that when you nest it, >> conflicts with the right shift operator. And is it really so weird and unconventional to think that maybe < means “less than”? It is probably also impossible to implement in a dynamically-typed language, where the compiler doesn’t have any type information at parse time. (Some might mark that as a point against dynamic typing, but I take the opposite conclusion.)

Otherwise, thank you for taking the time to write up your impressions, and I hope you’ll stick around for julia 2.0 when we can entertain more radical ideas — but I also hope you decide that syntax is not where most of the action is :slight_smile:

22 Likes

My dream of getting rid of lousy infix notation for sexprs is crushed.

4 Likes

I don’t have a strong opinion about in vs , but I am not sure that this specifically is a practical concern for most people.

1 Like

@Jeff: I agree.
@Tamas_Papp: That’s true. Unicode problems were addressed on stackexchange: naming - Is it bad to use Unicode characters in variable names? - Software Engineering Stack Exchange

People have been using Unicode in Julia successfully for years. In my opinion all the Python answers slamming Unicode there are just post-hoc rationalizations: “Python doesn’t support this properly so it must be better not to use it, right? Right?!?” Julia code based on mathy papers where the notation in code matches the notation is much easier to read and review than code that awkwardly spells out greek names in ASCII. What those SO answers seem to miss is that code doesn’t live in isolation.

17 Likes