Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
are there any terrible programming languages with roman numeral literals?

e: lol https://www.python.org/dev/peps/pep-0313/

Adbot
ADBOT LOVES YOU

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

the talent deficit posted:

that graydon hoare post is really interesting and briefly hits on my biggest frustration with our current family of languages: they're designed for compilers/interpreters not people

well that's harsh but fair, i guess we

the talent deficit posted:

even languages that are - in theory - designed to be amicable to extensive tooling (go, kotlin, typescript) are really pretty poo poo for actually working with

wait so your actual complaint is that programming languages aren't designed enough for computers instead of people

the talent deficit posted:

maybe you get an easy way to rename a function at all call sites

that's an ide feature and most languages don't really get in the way

the talent deficit posted:

or get an error when you omit a required argument

i certainly hope so

the talent deficit posted:

and maybe there's a proscribed canonical style but i've never seen (good) support for multiple mutually compatible syntaxes

why would you even want this? yes let's intentionally provoke more style wars among our users because reasons. like it wouldn't even make it easier to write tools because you'd need to support refactoring both syntaxes which means double the problems. it would just make it easier to write really lovely tools that gently caress up code they weren't expecting and probably insert code in a syntax that doesn't match the surroundings

the talent deficit posted:

or automatic refactoring more complicated than extracting some code to a new function or any sort of program control flow introspection

why would either of these require changes to the programming language

the talent deficit posted:

personally, i feel this is because the AST of a language is generally an afterthought when compared to the (textual) syntax itself and only exists incidentally as a compilation step. i spend a lot of time wondering what a language designed from the AST up would look like

if you want a programming language that intentionally looks like an ast dump so that you can more easily write tools for it, you want a lisp. otherwise this is not really about language design at all

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

MALE SHOEGAZE posted:

are there any terrible programming languages with roman numeral literals?

e: lol https://www.python.org/dev/peps/pep-0313/

i'm really sad this was rejected. just imagine the hysterical stack overflow questions about how naming a variable "X" or a class "DLC" produced baffling misbehavior.

also this disclaimer would not be out of place in a hacker news comment:

quote:

Programs that use variable names that are all upper case and contain only the characters M, D, C, L, X, V and I will be affected by the new literals. These programs will now have syntax errors when those variables are assigned, and either syntax errors or subtle bugs when those variables are referenced in expressions. Since such variable names violate PEP 8 [3], the code is already broken, it just wasn't generating exceptions. This proposal corrects that oversight in the language.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
can someone make a language that refuses to compile if the source code is not in the proper style? just like, bake indentation into the parser and make sure each line is max 100 chars or whatever long

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Asymmetrikon posted:

can someone make a language that refuses to compile if the source code is not in the proper style? just like, bake indentation into the parser and make sure each line is max 100 chars or whatever long

have u heard of python my man?

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

fart simpson posted:

have u heard of python my man?

python doesn't even error on pep-8 violations, and that doesn't cover anything a style guide should cover (how a docstring is formatted, for instance)

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Asymmetrikon posted:

can someone make a language that refuses to compile if the source code is not in the proper style? just like, bake indentation into the parser and make sure each line is max 100 chars or whatever long

quote:

INTERCAL has many other features designed to make it even more aesthetically unpleasing to the programmer: it uses statements such as "READ OUT", "IGNORE", "FORGET", and modifiers such as "PLEASE". This last keyword provides two reasons for the program's rejection by the compiler: if "PLEASE" does not appear often enough, the program is considered insufficiently polite, and the error message says this; if too often, the program could be rejected as excessively polite. Although this feature existed in the original INTERCAL compiler, it was undocumented.

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

Asymmetrikon posted:

python doesn't even error on pep-8 violations, and that doesn't cover anything a style guide should cover (how a docstring is formatted, for instance)

most of pep8 is questions of style, and every text editor above the level of notepad.exe is going to give you help for when you stray away from the mind of guido (pbuh)

do you really want the compiler to sperg at you because the file ends with an extra newline

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

oh my god does it mean that the PLEASE feature was undocumented but "on by default"? that's absurd.

jony neuemonic
Nov 13, 2009

ultravoices posted:

do you really want the compiler to sperg at you because the file ends with an extra newline

yeah, sure. if it's going to fail the ci build or code review anyway, why not catch it as early as possible?

though something like clang-format on save is probably friendlier if you can get everyone to set it up.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

ultravoices posted:

do you really want the compiler to sperg at you because the file ends with an extra newline

ideally, the compiler would let you just auto-format everything when it compiled (and tell you what formatting changes it made, maybe)

like gofmt, but mandatory, and for actually a good language

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

jony neuemonic posted:

yeah, sure. if it's going to fail the ci build or code review anyway, why not catch it as early as possible?

though something like clang-format on save is probably friendlier if you can get everyone to set it up.

every python ide that anyone is going to bother to use has pep8 "hey there sparky, do not upset the wa with your from somepackage import * horsepucky, namaste."

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

ultravoices posted:

every python ide that anyone is going to bother to use

given the state of the art of python library code, this is "no ide whatsoever"

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

Asymmetrikon posted:

given the state of the art of python library code, this is "no ide whatsoever"

what do you find specifically offensive?

pseudorandom name
May 6, 2007

MALE SHOEGAZE posted:

oh my god does it mean that the PLEASE feature was undocumented but "on by default"? that's absurd.

I don't think you understand the point of INTERCAL

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

ultravoices posted:

what do you find specifically offensive?

logging, unittest, wxPython, yapf (especially egregious given it's a python formatter) all camelcase methods; a bunch of python stdlib packages having their members named using a completely different naming scheme (camelcase modules like ConfigParser, pseudo-c names in os and shutil). Some of this is fixed in python 3, admittedly. it's also the fact that a majority of python programmers I've worked with treated pep8 as only a loose guideline and just wrote it in their own idiosyncratic style, which isn't necessarily a reflection of the way the greater python community works, but something i've had to deal with a lot.

more annoying to me is that there's three different styles of docstring (ReST, Google, Numpy). this isn't a python specific problem, but i feel like if you're going to make a docstring a separate entity from a comment, you might as well give it some kind of defined structure so there aren't competing standards.

also they should just remove "from x import *" from the language

jony neuemonic
Nov 13, 2009

ultravoices posted:

every python ide that anyone is going to bother to use has pep8 "hey there sparky, do not upset the wa with your from somepackage import * horsepucky, namaste."

but that still doesn't do anything to catch stuff before it hits ci / review, given a "determined" enough programmer. admittedly this is getting into throwing tech at social problems territory, though.

tef
May 30, 2004

-> some l-system crap ->

the talent deficit posted:


personally, i feel this is because the AST of a language is generally an afterthought when compared to the (textual) syntax itself and only exists incidentally as a compilation step. i spend a lot of time wondering what a language designed from the AST up would look like

they stopped at s-expressions

Athas
Aug 6, 2007

fuck that joker

MALE SHOEGAZE posted:

are there any terrible programming languages with roman numeral literals?

https://futhark-lang.org/blog/2017-04-01-roman-numerals.html

tinaun
Jun 9, 2011

                  tell me...

Asymmetrikon posted:

ideally, the compiler would let you just auto-format everything when it compiled (and tell you what formatting changes it made, maybe)

like gofmt, but mandatory, and for actually a good language

a place i used to work had this in their custom compiler / ide setup

of course i wouldn't call "an unholy mix of mumps and java 1.2" a good language but what can you do

gonadic io
Feb 16, 2011

>>=

Asymmetrikon posted:

ideally, the compiler would let you just auto-format everything when it compiled (and tell you what formatting changes it made, maybe)

like gofmt, but mandatory, and for actually a good language

At work our builds get rejected if scalafmt produces any changes. At least once a day the build will fail and then somebody will push straight to dev with the commit message "scalafmt <3". I did look up how to make it a local commit hook on git but nobody bothered

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

gonadic io posted:

At work our builds get rejected if scalafmt produces any changes. At least once a day the build will fail and then somebody will push straight to dev with the commit message "scalafmt <3". I did look up how to make it a local commit hook on git but nobody bothered

make it a pre push hook

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Asymmetrikon posted:

ideally, the compiler would let you just auto-format everything when it compiled (and tell you what formatting changes it made, maybe)

like gofmt, but mandatory, and for actually a good language

That'd gently caress up any toolchains that use "is different from what is committed" to determine whether it's a hacked-up build and append a dirty marker to the version string.

gonadic io
Feb 16, 2011

>>=

Malcolm XML posted:

make it a pre push hook

I mean in an ideal world merge requests would have tests run on the product of the merge before you can merge it

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

jony neuemonic posted:

but that still doesn't do anything to catch stuff before it hits ci / review, given a "determined" enough programmer. admittedly this is getting into throwing tech at social problems territory, though.

excuse me bob, your code has failed aesthetic review. please submit to mandatory vaporwave rehab.

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

a comp sci professor of mine said one of his favorite things when he worked in industry was when he worked at a place with an auto formatting system. it was set up so that when each programmer pulled code to work on it converted it to their preferred formatting style, and when they pushed to the repository it got formatted in a standard way. he said it worked well enough that they never wasted time arguing about whitespace or anything. this would have been in the 90s or earlier when he worked there, so i always chuckle that we're still arguing over this stuff (and probably will continue to argue about it forever)

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





rjmccall posted:

wait so your actual complaint is that programming languages aren't designed enough for computers instead of people

if you want a programming language that intentionally looks like an ast dump so that you can more easily write tools for it, you want a lisp. otherwise this is not really about language design at all

no my complaint is that we focus on the terminal ends; the syntax and presentation and the compiler/interpreter. tools are left to try to work with either textual representations that are designed for human readability (if we're lucky) or a representation that is designed to be executed in some manner. what i'm saying is that maybe we could get better tooling by working on more expressive, more flexible ASTs

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?
why would you want the code to be readable by unworthy hu-mans?

crazypenguin
Mar 9, 2005
nothing witty here, move along

rjmccall posted:

that's an ide feature and most languages don't really get in the way

most languages do get in the way. A lot.

Every dynamic language gets in the way of a renaming refactoring. Every static language with a macro system of some sort. Every cute name-punning convention.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

the talent deficit posted:

no my complaint is that we focus on the terminal ends; the syntax and presentation and the compiler/interpreter. tools are left to try to work with either textual representations that are designed for human readability (if we're lucky) or a representation that is designed to be executed in some manner. what i'm saying is that maybe we could get better tooling by working on more expressive, more flexible ASTs

again, you understand that an AST is an internal representation designed for the purposes of some specific tool, right? like you're basically complaining that compiler/interpreter writers are writing compilers/interpreters instead of the tools you would prefer

i have worked with people writing tools on top of my rich, semantically-annotated compiler asts for years, and i have heard this complaint before, and it basically always boils down to "why don't you annotate it with exactly the information i want and no more" which is a lot more of a whine than a request

crazypenguin posted:

most languages do get in the way. A lot.

Every dynamic language gets in the way of a renaming refactoring. Every static language with a macro system of some sort. Every cute name-punning convention.

on the one hand, you're right, but on the other hand, those language features were not added specifically to stymie tooling. they are actually valuable and important features

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

i'm sure some language designer is a hardcore vim enthusiast and specifically designed things to make it hard for full-fledged ides to refactor

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





rjmccall posted:

again, you understand that an AST is an internal representation designed for the purposes of some specific tool, right? like you're basically complaining that compiler/interpreter writers are writing compilers/interpreters instead of the tools you would prefer

again, you understand that's my whole point right? ASTs are designed for a single purpose and not as an accessible representation of a program in their own right

i'm not criticizing anyone or any current languages, i would just like to see what we'd end up with if we started at AST and worked out rather than starting at the ends and working in

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

the talent deficit posted:

again, you understand that's my whole point right? ASTs are designed for a single purpose and not as an accessible representation of a program in their own right

i'm not criticizing anyone or any current languages, i would just like to see what we'd end up with if we started at AST and worked out rather than starting at the ends and working in

scheme

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



the talent deficit posted:

again, you understand that's my whole point right? ASTs are designed for a single purpose and not as an accessible representation of a program in their own right

i'm not criticizing anyone or any current languages, i would just like to see what we'd end up with if we started at AST and worked out rather than starting at the ends and working in

idgi

like what should the ast be like in your perfect world?

isn't the ast just one of many steps between turning some text into some bytes??

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture






scheme is close (and maybe the best we can do) but it was still designed first and foremost to be executed

the stuff matthew flatt and matt might did at utah I exactly what I mean when i say i'd like to see a language designed AST out

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
i mean, okay, but the advanced macro systems in languages like racket actually make tooling much much harder, not easier. basically everything is great if you can do it directly in the macro system but otherwise it's totally hosed

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





rjmccall posted:

i mean, okay, but the advanced macro systems in languages like racket actually make tooling much much harder, not easier. basically everything is great if you can do it directly in the macro system but otherwise it's totally hosed

right, that's why scheme is not really a great example. you can't really build a type system as a macro

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

the talent deficit posted:

right, that's why scheme is not really a great example. you can't really build a type system as a macro

this article begs to differ

e: the original paper

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Powaqoatse posted:

idgi

like what should the ast be like in your perfect world?

isn't the ast just one of many steps between turning some text into some bytes??

typescript is a compiler that produces javascript. what if typescript was a tool that could type check an (enriched) javascript AST? then you could also use the typescript type checker on your hobby language that compiles to javascript AST. this wouldn't work for javascript because there's no AST specification (and i believe chakra, v8, nitro and jaeger all use their own internal ASTs) and because there's no way to extend the javascript AST but that doesn't mean it's not possible if you design an AST with that in mind

consider also async/await. in c# (and probably most other implementations) async/await is just some annotations that tell the compiler to convert imperative code into state machines. in a theoretical AST first language that allowed arbitrary annotations you could build your own async/await tooling (assuming the language has the primitives necessary, of course) without needing changes to the compiler or the parser

or if you want to mix and match traditional OO style programming with algebraic data types you could write a tool that transforms your product types into classes and your sum types into if/else chains

or you want to add pattern matching to the language you can just write a tool that transforms your pattern matches into automata before you hand off the AST to the interpreter/compiler

or or or

there's a million things you can do if you have direct access to an AST that is designed with extensibility in mind. the problem with applying this to current languages is that either their AST wasn't designed with this in mind (scheme, lisp, elixir) or that their AST just isn't readibly accessible. or both

Adbot
ADBOT LOVES YOU

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture






that's a wild paper. i'm gonna spend some time with it. thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply