|
are there any terrible programming languages with roman numeral literals? e: lol https://www.python.org/dev/peps/pep-0313/
|
# ? Aug 28, 2017 01:49 |
|
|
# ? May 22, 2024 13:38 |
|
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
|
# ? Aug 28, 2017 02:11 |
|
MALE SHOEGAZE posted:are there any terrible programming languages with roman numeral literals? 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.
|
# ? Aug 28, 2017 02:44 |
|
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
|
# ? Aug 28, 2017 03:02 |
|
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?
|
# ? Aug 28, 2017 03:29 |
|
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)
|
# ? Aug 28, 2017 03:34 |
|
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.
|
# ? Aug 28, 2017 03:37 |
|
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
|
# ? Aug 28, 2017 03:47 |
|
oh my god does it mean that the PLEASE feature was undocumented but "on by default"? that's absurd.
|
# ? Aug 28, 2017 04:36 |
|
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.
|
# ? Aug 28, 2017 04:37 |
|
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
|
# ? Aug 28, 2017 04:41 |
|
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? 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."
|
# ? Aug 28, 2017 05:01 |
|
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"
|
# ? Aug 28, 2017 05:03 |
|
Asymmetrikon posted:given the state of the art of python library code, this is "no ide whatsoever" what do you find specifically offensive?
|
# ? Aug 28, 2017 05:07 |
|
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
|
# ? Aug 28, 2017 05:17 |
|
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
|
# ? Aug 28, 2017 05:34 |
|
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.
|
# ? Aug 28, 2017 05:44 |
|
the talent deficit posted:
they stopped at s-expressions
|
# ? Aug 28, 2017 07:16 |
|
MALE SHOEGAZE posted:are there any terrible programming languages with roman numeral literals? https://futhark-lang.org/blog/2017-04-01-roman-numerals.html
|
# ? Aug 28, 2017 07:32 |
|
Asymmetrikon posted:ideally, the compiler would let you just auto-format everything when it compiled (and tell you what formatting changes it made, maybe) 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
|
# ? Aug 28, 2017 07:43 |
|
Asymmetrikon posted:ideally, the compiler would let you just auto-format everything when it compiled (and tell you what formatting changes it made, maybe) 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
|
# ? Aug 28, 2017 09:04 |
|
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
|
# ? Aug 28, 2017 12:07 |
|
Asymmetrikon posted:ideally, the compiler would let you just auto-format everything when it compiled (and tell you what formatting changes it made, maybe) 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.
|
# ? Aug 28, 2017 12:09 |
|
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
|
# ? Aug 28, 2017 12:21 |
|
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.
|
# ? Aug 28, 2017 13:57 |
|
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)
|
# ? Aug 28, 2017 15:49 |
|
rjmccall posted:wait so your actual complaint is that programming languages aren't designed enough for computers instead of people 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
|
# ? Aug 28, 2017 18:11 |
|
why would you want the code to be readable by unworthy hu-mans?
|
# ? Aug 28, 2017 18:23 |
|
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.
|
# ? Aug 28, 2017 19:00 |
|
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. 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
|
# ? Aug 28, 2017 20:00 |
|
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
|
# ? Aug 28, 2017 20:38 |
|
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
|
# ? Aug 28, 2017 21:18 |
|
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 scheme
|
# ? Aug 28, 2017 21:24 |
|
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 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??
|
# ? Aug 28, 2017 21:33 |
|
leper khan posted:scheme 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
|
# ? Aug 28, 2017 22:14 |
|
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
|
# ? Aug 28, 2017 22:32 |
|
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
|
# ? Aug 28, 2017 22:50 |
|
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
|
# ? Aug 28, 2017 22:53 |
|
Powaqoatse posted:idgi 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
|
# ? Aug 28, 2017 23:11 |
|
|
# ? May 22, 2024 13:38 |
|
Asymmetrikon posted:this article begs to differ that's a wild paper. i'm gonna spend some time with it. thanks!
|
# ? Aug 28, 2017 23:12 |