« first day (4389 days earlier)      last day (440 days later) » 

12:08 AM
Oh wow, I just realized I asked my 300th challenge today.
 
12:20 AM
Congrats!
LDQ: I'm making a language with macros. I'm thinking I'll probably have to compile the modules with macros before the modules that depend on them. One way to do that would be to go through all the modules before doing anything to see which modules they depend on. Another, much easier, way to do that would be to have the user declare which modules they're using at the top of each module, sorta like Python. Which would you guys recommend? (are there other solutions I'm missing?)
I think I'll just go with the first solution. It's more difficult to implement but much easier for users
 
Wdym? Like, macros don't need to be imported?
Seems like that's a bad idea
What if two modules define macros with the same name?
 
12:36 AM
What about it?
 
Wouldn't that break things since there's no way to clarify which module you're getting the macro from?
 
You just use the module name
You wouldn't be allowed to import both macros ig
 
@user Wait so you do have to import them?
 
Well that's what I'm asking, should I require importing every module you're using or not?
 
Of course
How would it even know what you are and aren't using otherwise? Just seeing what's in the same folder?
 
12:38 AM
wdym?
 
I think I'm misunderstanding what you're talking about
 
If I call a function like Foo.bar(3), then it's clear that I'm referring to the bar defined in Foo and not the bar defined in Baz
 
Oh true
 
But for the compiler to know that the Foo module is being used somewhere in your module, it'd either have to go through your entire module or you'd have to declare that you're using Foo at the top
 
And then you'd use a using sort of thing to make Foo::bar accessible just with bar?
 
12:41 AM
@user Actually, ignore this message, importing modules and importing stuff inside modules isn't quite the same thing
@RydwolfPrograms Yup
 
@user I think there's advantages to both, I'd go with the latter tho, more for humans than for computers
 
I don't like the Haskell-style imports where everything inside the other module gets imported unless you use qualified
 
Knowing what all a module depends on is useful for humans
 
Good point
 
Also, is Foo.bar gonna be the syntax? That seems like it could be ambiguous with things defined in the same module
E.g., if my program has a Qux struct, then someone else starts using a library with a Qux module
 
1:00 AM
Yeah, I was considering ::, but it's actually not possible to do Foo.bar on a type Foo here, so it's alright
Only problem would be if you do something like import Foo.Bar and there happens to be both a module Bar and a type Bar in Foo. I'll probably just have both the module and the type added to the scope then
 
1:34 AM
Rol uses : for module separation
lib:somethingElse()
 
2:08 AM
0
A: "Hello, World!"

gilduxdc, 16 bytes One of my favorite calculator was missing, this should correct it. [Hello, World!]p

0
A: "Hello, World!"

gilduxHP User RPL, 14 bytes Thanks Corvalis "Hello, World!"

 
1
A: "Hello, World!"

Digital Traumadc, 16 bytes [Hello, World!]p I can't think of any way to get this one shorter.

 
2:22 AM
LDQ: is it a good idea to treat functions as variables with a function type?
 
Depends. If your language is going to have a lot of higher-order functions, it's probably a good idea
If you want overloading, probably not a good idea
If it might hurt performance somehow, probably not a good idea
Looks like functions are already first class in Lua, and if you're not going to have overloading, not much reason not to make them plain variables
 
@user why not
 
Because then you would have multiple variables with different types. It'd be weird
class Foo {
  Function<String, Integer> foo;
  Function<List<String>, Integer> foo;
}
You'd have to allow variables with the same name but different types
 
2:37 AM
you could also make it possible to represent overloading on the type level, which may work great or absolutely terribly depending on what kind of overloading you have :P
 
@Razetime Hi!
 
By the way, where did you find the ==== mentioned here?
Oct 23, 2022 at 16:18, by Razetime
what on earth does ==== do in scala?
 
@mousetail what???
@user yeah it was some library thing
 
Do you happen to remember which library?
 
2:38 AM
this isn't for real, we actually have bracmat lotm
no, i do not
 
:( I was hoping to send them an angry email
 
@user yeah true
 
@flawr ooh, thanks
 
@UnrelatedString Ooh that sounds delightfully cursed
 
tho id ditch overloading for such a streamlining in my compiler
and the language itself
 
2:39 AM
let x = "foo" in
let x = 5 in
putStrLn x # Heehee
 
dynamic languages do get along without overloading...
 
Yeah, ditching the C/Java sort of overloading is totally valid
 
oh
oh no
that is so cursed
 
You could still have the Rust sort of overloading
 
like?
 
2:40 AM
Typeclasses
 
nah ive ditched those too
 
Oh right, you went OOP
 
one way around could be bidirectional type inference
 
i was thinking more if you don't go for the correct approach of typeclasses, you'd have the overload type implicitly get built up with function definitions but not with normal values
but that's funnier
 
basically saying "what kind would you like"
but thatd be cursed
 
2:42 AM
like normal variable definitions just shadow but the function syntax overloads, but you can also make value overloads explicitly like Both("foo", 3)
 
Maybe not, do you have an example of what you mean? I'm not getting it
 
do y'all mind if I give the LoTM to Arn
I am not really in the best time to be participating in or running one
 
I don't think anyone would object
 
CMM: Before that, though, is someone else willing to run Bracmat?
(and do we have someone for Arn or would we need to skip that too?)
 
2:44 AM
@user say i have foo(1). the AST will be smth like Call(Variable(foo), 1). so when typing the call, it will also save the types of its arguments (Int) and pass that on when typing foo to get the correct overload
id like to allow overloading for function variables but thatll be weird; why should it only work on function variables?
 
Yeah, you'd have to support it for all variables
@Seggan This would get a bit tough with generics, but I guess languages like Java already deal with that
Are you planning on fancy type inference that can also go backwards?
 
the one i just described is a backwards inference
since foo is a child of the call
and children are usually typed first
 
29
Q: Hello world! with NO repetition

TimtechIn any programming language that existed before this question was asked, write a program (not a function) that outputs the characters Hello world! followed by a newline. Your program: should not use any character more than once (including whitespace) should only use ASCII characters should not ...

 
maybe it's time to start renominating previously used languages for lotm so it can be revived
 
3:10 AM
Maybe it's time to put it on hold for a while
As the saying goes, "Everything must end"
Or maybe it's "End everything," I don't remember
 
14
Q: Salacious Bacon Tripod

lyxalIn a certain chatroom, we like making acronym jokes about the build tool we use called sbt. While it usually stands for "Scala Build Tool", we aim to come up with all sorts of meanings, such as: Stupid Brick Teeth Sussy Baka Training Shady Blue Tourists Seriously Big Toes Silly Bear Topics Salac...

 
LDQ: Should I allow circular dependencies between modules?
I'm not sure if it's always possible to eliminate circular dependencies between modules entirely
 
if you can implement it then absolutely
or i guess it depends on what level of organization a module represents
but i think it's a good idea in general
 
It's a good idea to allow circular dependencies or disallow them?
 
allow
all i know is it's a pain in the ass that haskell disallows it :P
 
3:23 AM
@UnrelatedString Folders are modules, files are modules, and you can make more modules inside files (and modules inside those)
 
yeah go for it
 
@UnrelatedString You know, the fact that Haskell disallows them kinda makes me want to disallow them too
But I also don't want to cause anyone's ass any pain, least of all mine, so I guess I'll allow them
 
it has been ages since i've looked at the codebase i was trying to do circular module dependencies in so there might also just be something fundamentally wrong with how i was trying to organize things :P
 
According to this thread, it's also a problem for other people, so it's definitely not just you
 
that's a bit of a relief
 
 
1 hour later…
4:47 AM
This esolang I've been working on is...well I can't say but I am sooo excited to release it
For reasons I can't disclose it's going to require a somewhat complex UI for the interpreter tho, so it'll be a bit of a grind to get it to the point where I can release it
The encoding is incredibly complex and has required me to learn about data compression, probability, and number theory
And it's definitely worth it
 
oh boy
is it at least somewhat designed for golfing or is the basic concept just that crazy
 
Not designed for golfing, but it will be fairly interesting and difficult to optimally golf a program in it
 
 
1 hour later…
6:09 AM
@Razetime I think you won language of the month
 
 
2 hours later…
8:04 AM
@mousetail wait OEIS has plotting features?
TIL
 
 
1 hour later…
9:35 AM
@mousetail yup i'm transferring to arn, or anyone else who wants to host lotm
 
 
3 hours later…
12:55 PM
CMC: Given a number, return the number with the last two digits swapped. Input will be integer and > 9
e.g. 1261 -> 1216
 
1:11 PM
Any language default such input and a swap-top solve it?
 
oh yeah i feel like there is a stack language out there somewhere that does that
for strings definitely
but possibly for integers on the less golf oriented side of things
(or rather having no true integer i/o to begin with :P)
 
ayyyyyyyyyyy
 
I'm genuinely sorry that language exists
 
@lyxal Python, 28 bytes: lambda n:n+(n%10-n//10%10)*9
 
1:26 PM
ooh. the *9 at the end is clever
 
can be 27 bytes in Python 2 of course
 
1:48 PM
0
A: Sandbox for Proposed Challenges

The ThonnuSum of consecutive squares code-golf decision-problem math number Your task Given a integer input, \$ n \$ (such that \$ n > 1 \$), decide whether it can be written as the sum of (at least 2) consecutive square numbers. Test cases Truthy: Input Explanation 5 1 + 4 13 4 + 9 14 1 + 4...

 
2:11 PM
@lyxal Thunno, 16 chars: zt10%s10,10%-9*+ (Port of pxeger's Python solution)
Or with flags: Thunno E J, 6 chars: AusZMr
 
 
1 hour later…
3:28 PM
I've come here to chew bubblegum and update wiki pages, and I'm all out of bubblegum
 
 
1 hour later…
4:32 PM
@lyxal Fig, 5 chars (~4.116 bytes) if I/O as digit list and s worked properly: $s@$$
10 chars (~8.231 bytes) if I/O as digit list:
$
$J$t2xs2
@RydwolfPrograms hmm arithmetic coding?
@user yes if you wanna break your brain on how to implement them
 
5:16 PM
@Seggan Close
 
asymmetric numeral systems?
 
Well, it does involve arithmetic coding, just as a part of it rather than the whole thing
But no more details :p
 
you promised to tell us it a week ago
 
I should have it finished by the end of this week probly
 
the week has already ended :P
 
5:20 PM
Well then it isn't this week anymore is it :p
 
well we still have half a day
 
 
2 hours later…
7:33 PM
@user apparently lua does this exact thing: function foo() return "bar" end is the exact same thing as foo = function () return "bar" end
 
 
4 hours later…
11:04 PM
I’ve run into a language design issue. type* identifier is ambiguous to expression * expression, but I wish to avoid a dedicated variable declaration keyword.
Additionally, x = int y although is non-ideal, is allowed.
 
What's the * after type for?
Is it specifically a pointer?
 
Yea, I considered in the past using a keyword instead of a symbol
 
int <- name = value
Because name points to an int
 
Ooh, I like that. Also sort of matches me using -> for return types and casts
 
All the more reason to use it :p
 
11:11 PM
That said, it does create ambiguities for less-than unary minus
 
<_
 
But a space after the < forces differentiation when doing lt unm
 
Or <-- (or <~
 
a < -b
 
But also, int <- name doesn't even make sense logic wise
How can a type be less than a negated name that may not even be defined yet
 
11:14 PM
Horrifying metamethods and abstract types
It’s valid because I wish to allow people to do horrible things with types
 
And then unless you can assign values to booleans, int <- name = whatever also doesn't make sense
 
@ATaco Would x: int = y work? I saw a language that did that, and x := y meant the type had to be inferred
 
<: could also visually indicate a pointer
 
In this case, <- can be differentiated from a < -b, so it works
 
11:36 PM
what language are you making
 
I’m calling it BrainChild, a compiled strictly typed language
 
Any unique features?
Looks like you have types that can be manipulated at runtime?
 
11:54 PM
Types are only defined at compile time and there are very few innate types, but the type system allows for complex types
The stack however doesn’t support variable size data, so any data type bigger than a short has to be allocated to the heap
Expressions can also consume and return more than one value of the stack
 
TIL exists. Could be cool for sbcs aesthetics if you don't want single = to be equality
 

« first day (4389 days earlier)      last day (440 days later) »