Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

The perfect /prog/lang

Name: Anonymous 2015-04-23 15:00

I'm trying to determine the common traits of /prog/-approved languages:
lets start
1.GC is shit.
Does everyone agree? Are incremental GC's or automatic refcounting also shit?

Name: Anonymous 2015-04-23 15:18

Types are ultimately still just strings of ones and zeroes.

Name: Anonymous 2015-04-23 15:48

The perfect language would be as safe as Ada, as expressive as Lisp, as clear as Python and as fast as C.
What exact features would make it perfect?

It would be small in design and fast to parse.
Elegant minimal languages are the way to start. Libraries should pick up the parts which are expressible, and if desired migrated to the core language. Syntax rules should be expressible in EBNF succinctly.

It would not force to do things One True Way.
One True Way often excludes optimizations, tweaks and creates a sense of limits in the design. Petty restrictions and limits would ruin any language:initial impressions matter. There should be ways to create many correct variations of same code.

It should catch most errors at compile time. The Ada language strength is of course annoying one, but the language should have the safety before runtime. The key is not overdo the safety parts, forcing the programmer to write around many restrictions.

It should be approachable to beginners.
Syntax should be friendly and easily parsed, language syntax determines readability and usability(code maintenance):the secret to Pythons success is the simple syntax.

It should easily inter-operate with mainstream languages and OSes.FFI and OS interface should be done before libraries.
Python other strength is the vast number of libraries and the easy interface to everything.

It needs to have an optimizing compiler and support for low-level code and native machine types. The power of C is the flexibility for unlimited optimization(even without inline assembler and intrinsics). The language should have both compiler-side and code-side optimization possibilities.

It needs syntax macros. Metaprogramming with macros is the key power of Lisp family.

Name: Anonymous 2015-04-23 15:56

>>2
Types describe the lengths and relations between those ones and zeros. The bitstrings are the data content of the type, not the type itself.

Name: Anonymous 2015-04-23 16:07

>>2
Consider a 64-bit integer and 64-bit float:
1.They're both contain 64 bits.
2.The first bit of float is the sign, the next 11 are the exponent and the last 53 are the mantissa.
3.The first bit of integer is the sign and the rest are positions of powers of 2.
4.Different bits in both numbers have different roles.

Name: Anonymous 2015-04-23 16:09

>>3
fast to parse.
No. Nobody fucking cares about parsing speed, cause it's never a bottleneck.

It should be approachable to beginners.
No. The perfect language should cater to programmers, not to newfags from hackerreddit.

The rest of the points are fairly good.

Name: Anonymous 2015-04-23 16:33

>>6
Nobody fucking cares about parsing speed
Not every program is a one-page demo. Consider large-scale projects. Take for example Firefox and Chrome.
The perfect language should cater to programmers.
Consider APL readability as extreme "anti-popularity" feature.
The less cryptic languages are clear to maintain and modify. Clever terse one-liners and obfuscated code can't be reused.
Languages grow from these "newfags", just think the first time you approached your favorite language. You have been a "newfag" before the proficiency.
It should be a fast path from newbie to competent programmer.

Name: Anonymous 2015-04-23 16:34

It's almost like you are talking about HASKAL

Name: Anonymous 2015-04-23 17:11

>>7
Not every program is a one-page demo
Not every module needs to be recompiled every time you change one line of source code.

Consider APL readability as extreme "anti-popularity" feature.
It's an excellent feature: it keeps away webmonkeys and other idiots, and makes sure that only good programmers use the language, improving the community.

Clever terse one-liners and obfuscated code can't be reused.
Only if you're a newfag or a loser. But that's not the audience the perfect language should cater to.

It should be a fast path from newbie to competent programmer.
Because your cubicle farm needs lots of cheap disposable coders? You sound like another corporate Enterprise Java bullshit-monger.

Name: Anonymous 2015-04-23 17:33

>>5
That's stupid, you should use packed BCD.

Name: Anonymous 2015-04-23 18:10

>>9
Not every module needs to be recompiled every time you change one line of source code.
Nested abstractions can be slow to compile regardless, and larger codebases contain more of them. Splitting code into small modules is an anti-pattern due compiler deficiency(in parsing these nested abstractions) which forces the programmer to follow a map of dependencies for every module instead of working with larger files. i.e. moving the work to the programmer, complicating large projects. Code should be modularized within files as components, not separate files(e.g. having 1000 files per 1000 functions to avoid slow compile).

|It's an excellent feature:
No. A language should be easy to learn. Limiting your audience is limiting industry support and small userbases have never proved themselves influential. You would end up with a small niche language, with very little new users. The experienced users of the language would not be as loyal as you think and would easily jump ship to greener pastures if alternatives are seen. In the end it would either fade into obscurity or become assimilated into a larger language which has less of a learning curve.

Only if you're a newfag or a loser.
Reusable components can of course be created from any hack or one-liner, given enough time. It just won't be the same code, at best it could be a prototype for a real component or module. Clever one-liners by themselves are just demos. If a complete component alternative exists, most programmers would use it instead of cryptic, unreliable or obscure "one-liner".

Because your cubicle farm needs lots of cheap disposable coders?
No. The world need competent programmers, there is shift towards mass computing controlling our civilization. If the tools are unreliable and the programmers remain incompetent we would stay within a quagmire of insecure, slow and buggy software forever. No magical genius team can handle the scale and breadth of software developed today and maintain it by themselves. Languages ill-suited for learning, cripple their proliferation permanently and deny their chance at industry and academia adoption, making them an unlikely target for future programmers.
The influence of the language depends on adoption:
Literature and compilers, libraries,frameworks,hardware manufacturers support,websites, modules all become insignificant if the userbase doesn't materialize due learning curves. Its futile to force the language on the audience and its equally futile to expect all elite programmers switch to it.

Name: Anonymous 2015-04-23 18:26

>>11
Splitting code into small modules is an anti-pattern due compiler deficiency(in parsing these nested abstractions) which forces the programmer to follow a map of dependencies for every module instead of working with larger files

I can't even guess what kind of drugs you take, but it must be something really hard. What compiler deficiency? Who forces the programmer to "follow a map of dependencies"? Any IDE will let the programmer instantly view information about any function defined in another file, as well as jump to its definition. But there is no reason to run a parser on the whole codebase when only a minor percentage of modules underwent changes.

Name: Anonymous 2015-04-23 18:52

anti-pattern
IHBT

Name: Anonymous 2015-04-23 19:15

>>10
Fixed-point arithmetic is a precise,faster alternative and arbitrary precision can be implemented without resorting to archaic formats.
>>12
The micro-modules which force to keep code in many separate units, making the software a mapping of these modules as a graph. Creating complexity which requires these IDE tools to decipher and maintain inter-module dependencies, essentially sacrificing programmer time for speed of (partial) compilation.
When you get used to such OOP-inspired refactoring approach of building large scale software it may seem counter-intuitive that tightly coupled components can be optimized better and even compile faster.
Forcing the dispersal of code into many files regardless of compilation time is the ""anti-pattern: factoring out slow-to-compile code and making it a separate module is actually faster to compile than jungle of micro-modules requiring each duplicate resources and separate unit tests.

Name: Anonymous 2015-04-23 19:39

Name: Anonymous 2015-04-23 19:46

And what is end result of maintaining such micro-module jungle?
“A Big Ball of Mud is a haphazardly structured, sprawling, sloppy, duct-tape-and-baling-wire, spaghetti-code jungle. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated. The overall structure of the system may never have been well defined. If it was, it may have eroded beyond recognition. Programmers with a shred of architectural sensibility shun these quagmires. Only those who are unconcerned about architecture, and, perhaps, are comfortable with the inertia of the day-to-day chore of patching the holes in these failing dikes, are content to work on such systems.


—Brian Foote and Joseph Yoder, Big Ball of Mud. Fourth Conference on Patterns Languages of Programs (PLoP '97/EuroPLoP '97) Monticello, Illinois, September 1997

Name: Anonymous 2015-04-23 19:57

>>15
Sugoi TVtropes ANTI-PATTERNS link, /g/roski!

Name: Anonymous 2015-04-23 20:01

>>16
The benefit of a "micro-module jungle" is lots of reusable, easily testable and flexible pieces of code.

Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated
This doesn't even make sense. What's bad in sharing "information" (code, actually)? Code reuse is a benefit. And this mention of sharing and duplication in the same sentence is simply self-contradictory. The whole point of reusing code is that it does not need to be duplicated. I think the Big Ball of Mud that the authors mention is an apt description of their own minds if anything.

Name: Anonymous 2015-04-23 21:03

Name: Anonymous 2015-04-23 21:18

>>19
Please refrain from referencing that vulgar site. c2 is everything /prague/ strives not to be.

Name: Anonymous 2015-04-23 22:06

>>6
Why do you hate yourself?

Name: Anonymous 2015-04-23 22:16

>>19
I sure love the Know your Meme of /prog/!.

Name: Anonymous 2015-04-23 22:44

>>19
RubeGoldberg
Shalom!

Name: Anonymous 2015-04-23 23:03

Name: Anonymous 2015-04-23 23:30

>>1
"GC is shit" is a meme. I use a lot of languages with it, but I need at least one solid one without it.

Refcounting is not technically GC, but you wouldn't notice unless you're implementing GC. It has worse throughput because of the constant counter incrementing/decrementing, but shit gets freed on time and pauses are short unless you have huge reference cycles.

>>2
Types are ultimately still just strings of ones and zeroes.
No, types are ultimately erased.

>>3
as safe as Ada, as expressive as Lisp,
Yes, if not more so, to both.

The important thing is: some stuff is enforced and you are given the tools to express application-specific invariants and so on.

as clear as Python and as fast as C.
No, it should be clearer than Python and faster (see below) than C.

C doesn't let the programmer express enough invariants to optimize the code completely. Technically you could solve this with analysis in NP (or worse maybe), so in practice C is not optimal. I don't think the programmer should be forced to do this, but should at least have the option.

It would not force to do things One True Way.
Agreed, but Python's style of clarity is based on that, and this is why Python isn't as clear as it could be. Many conceptually simple operations require tedious lists of operations in Python. I don't find the code any clearer than C. Lisp can almost always be clearer if well-written.

It should easily inter-operate with mainstream languages and OSes.
Agreed. This is rare, but the batting average is getting better.

Name: Anonymous 2015-04-24 12:40

>>19
Is there a source for this c2-bot? Can it post links from other sites too?

Name: Anonymous 2015-04-24 12:53

>>26
It would cost around three-fiddy, license for 1 user, 1 virtual machine, and you cannot sublicense and rent the bot.
Its written in Java using all the design patterns and frameworks, taking a hour and 15GB to load. It scales.
Also Perl can do it in 5 lines instantly but you wouldn't understand..the meaning of being lonely
Is this the feeling I need to walk with?

Name: Anonymous 2015-04-24 18:10

One where:
* The syntax for function calls, the delimiter for tuples and the expression grouping character aren't the same (parens).
* The delimiter for its basic data structure (usually arrays) doesn't collide with the block delimiting character (curly braces).
* The list index operator isn't the same as the data structure building syntax. (FIOC and friends' list[0] and list = [0])
* No symbols outside the ASCII standard are ever used.

>>19
Is this some kind of CODING MEME competition? What is this, /r/programming?

Name: Anonymous 2015-04-24 18:22

>>28
character aren't the same (parens)
Can you say overly complex shit-syntax? {([[({])}})][(]})

Name: Anonymous 2015-04-24 19:32

>>29
Not really. APL and J fulfill the first three conditions but their syntax is overly complex shit.

Name: Anonymous 2015-04-24 19:36

>>30
How does that contradict the fact that having a zoo of {[(])} leads to overly complex shit-syntax? You have a problem with logic and implications, boy.

Name: Anonymous 2015-04-24 22:07

>>28
Look, you want a shit syntax. Pick one of those languages where you can design your own syntax and just fuck it up, but don't share your code with anyone.

Name: Anonymous 2015-04-24 22:25

It should feature tons of memes.

Name: Anonymous 2015-04-24 22:25

>>29
Valid Clojure.

Name: Anonymous 2015-04-24 23:07

i wanna start writin a gramar with antlr but i dont know where to start, i mean i would like some cool new syntax full of cool symbols (you know like prolog) but everything i write looks like some already existent PL.... :{
and lisp is like the assembly of the PL`s becuase you write the AST (which is soo cool because you can do some clever metaprogramming tricks), also what do you thinkabout this “Propagator Programming Model” that Dr. Gerald Sussman was talking few years ago? I think you should start there

Name: Anonymous 2015-04-25 2:01

>>35
you seem alright

got a github? irc?

Name: Anonymous 2015-04-25 2:56

>>36
dunno man i just found this place thanx to some anon on /g/ (4chan) he said that this place was full of “expert programmers” and i wondered what a fuck man lol so maybe somebody can help me here. By the way, im also learning some Haskel, its the shit, and found this Happy Alex automatic parser its awsome lol you know what i mean right? I will be coding the hole week end :D #YOLO
(p.s. github is too mainstream, i do use sourceforge though) cya on irc!

Name: Anonymous 2015-04-25 3:24

>>37
changed my mind you are the worst

Don't change these.
Name: Email:
Entire Thread Thread List