ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 3:37 pm

John_Spikowski wrote:
Mon Nov 18, 2019 2:47 pm
The ScriptBasic submission is 35 lines (statements). PLEASE fix the chart. If not remove all ScriptBasic entries from the challenge.
Your request, which I will honour, makes me unhappy. I personally think the surprisingly easy way in which it is possible to mix small bits of C into a Script Basic program a powerful programming technique quite well demonstrated by the current entry.

It seems I've caused much of the current trouble by not announcing ahead of time how the star chart would be made. As a teacher I know to present a syllabus with a grading scale and to stick by it during the course. In this case, the reason for not announcing things ahead of time was three fold:
  • This is not a challenge I designed.
  • My role is that of a participant.
  • I didn't know there'd be a star chart.
Sorry for the misunderstanding. Please let me know if you have further concerns or ideas how to continue. This is, after all, supposed to be fun.

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 3:45 pm

Most of the members of this group care about only one thing. SPEED.

I think to be fair the challenge should have two distinctive submission groups. Compilers and Interpreters. Each have their own following.

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 3:53 pm

John_Spikowski,
There should be two classes. Compilers and interpreters. (scripting engines)
Perhaps.

Back in the day of the fibo and anagram challenge the focus was not on performance so much, as long as it was reasonable. The issue was comparing languages, that is syntax and semantics, for expressiveness, ease of creating a solution, ease of other people understanding what you had done and so on.

I'm not sure if that is the case anymore with the tatami challenge. Judging by the current performance leader clarity of expression to other humans is not a concern, even deliberately obfuscated.

If one makes two classes, Compilers and interpreters, that confuses things a lot:

1) Now one is not comparing languages but implementations.
2) There are plenty of languages around that can be compiled and interpreted. There is even an interpreted C++ available.
3) What about those that get compiled to byte code which is then run my an interpreter: Java, C# etc.
4) Sometimes the very semantics of the language can enhance or cripple the performance of a language no matter if it is compiled or interpreted.

And which one of those ScriptBasic entries uses a C extension and which not? Or do they both? Do they then go in the interpreted class being SB, or do they go in the compiled class being compiled C?

Confusing or what?

I don't know I'm not the challenge judge here.
Memory in C++ is a leaky abstraction .

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 4:00 pm

My concern is to prevent bias. My slow WIP post was assumed the submission until pointed out. If extension code lines are going to be counted then includes code count should be added to the others.

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 4:17 pm

It's not my place to say for this challenge but my feeling is:

1) Solutions should be presented in one language not two or more.

Rational - We are comparing languages are we not? Mixing them up in one solution makes comparison impossible.

Rational - Claiming that language X is great when one has actually created the difficult part in language Y is disingenuous.

2) Anything created to solve the problem that did not exist before should be included in the line count.

Rational - Prevents people writing the equivalent of "print (whateverFunc(1234))", where they have put whateverFunc in some library. And then claiming "Look that is easy in language X, only take one line of code"

That is why there was an insistence on "no non-standard" libraries in previous challenges. That was not even my suggestion but others agreed.
Memory in C++ is a leaky abstraction .

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 4:27 pm

ScriptBasic is written in ANSI C . The C functions it calls is what is referred to as SYNTAX. I'm only extending what ScriptBasic is already doing

You're going to have a hard time standing on the single language soap box.

ScriptBasic wouldn't be if it weren't for Perl and C.

ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 5:00 pm

Heater wrote:
Mon Nov 18, 2019 3:53 pm
I'm not sure if that is the case anymore with the tatami challenge. Judging by the current performance leader clarity of expression to other humans is not a concern, even deliberately obfuscated.
For the record, the code in limited.c has not been deliberately obfuscated. While, the algorithm is different, it is in my opinion more natural to compute T(s) one value at a time rather than simultaneously computing all values of T and then searching for the smallest s. As I did not comment the code nor describe the algorithm, I can see how a simple line count might lead one to believe one program is easier to understand than another. Note also the algorithms employed by petami.bas and factor.c are noticeably different than the others.

The reason memory use was included in the star chart was to highlight the difference of the two algorithms as well as indicate what obstacles a person living in the golden age might have encountered when trying to solve this problem. While CPU performance has increased 1000-fold from the MHz speeds of the PDP-11/20 used to run Unix at Bell Labs to the GHz speeds of the Raspberry Pi used everywhere to run Linux, the amount of available RAM increased 1000000-fold from kilobytes to gigabytes.

Not only are larger-sized problems within reach of newer computers, but the different evolutionary paths taken by different hardware components have resulted in the possibility of using different algorithms on those new computers. In my opinion, the working algorithms for the tatami challenge illustrate well the trade-off between computational complexity and memory usage in practical code.

Which is better depends on how much you like cabbage and what kind.

As stated before, rather then comparing algorithms, the focus of this thread is to determine which languages make a good choice for a beginning programmer to learn first.

ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 5:26 pm

John_Spikowski wrote:
Mon Nov 18, 2019 4:00 pm
My concern is to prevent bias. My slow WIP post was assumed the submission until pointed out. If extension code lines are going to be counted then includes code count should be added to the others.
In my opinion, it is important keep working code in progress around to determine whether the improved code
  • still generates correct answers
  • is actually better.
My experience is that improving a program often uncovers bugs in the original. At the same time, verifying improvements is equally important to avoid introducing new bugs.

I'm sorry the first start chart contained errors. That's why the star chart was and still is labeled preliminary.

Image
Image

Please clear your browser cache if the old chart is still displaying.
Last edited by ejolson on Mon Nov 18, 2019 6:14 pm, edited 3 times in total.

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 6:32 pm

jcyr,
Neither algorithm is hard to understand once the actual problem is analyzed and understood.
I seem to have two major problems:

1) I have no idea how to analyse and begin to understand the problem.

2) I get no clue from any of the codes I have looked at so far

:(

Not to worry, it only took me about twenty years between seeing my first Fast Fourier Transform in source code (BASIC) and understanding how the FFT worked well enough to write my own from scratch. Despite having understood the Fourier Transform well enough back at uni.
Memory in C++ is a leaky abstraction .

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 6:49 pm

So I was busying myself picking apart limited.c with a view to transcribing it to Rust. When someone suggested I just convert it to rust using c2rust : https://c2rust.com/

That's crazy I thought, it will generate horrible code. So I did it:

Code: Select all

#![allow(dead_code,
    mutable_transmutes,
    non_camel_case_types,
    non_snake_case,
    non_upper_case_globals,
    unused_assignments,
    unused_mut)]
extern crate libc;
extern "C" {
#[no_mangle]
fn printf(_: *const libc::c_char, _: ...) -> libc::c_int;
#[no_mangle]
fn exit(_: libc::c_int) -> !;
}
#[derive ( Copy , Clone )]
#[repr(C)]
pub struct Factors {
pub s: libc::c_long,
pub fmax: libc::c_int,
pub i: libc::c_int,
pub p: [libc::c_long; 10],
pub n: [libc::c_char; 10],
}
/*  limited.c -- Compute T(s) from Project Euler Problem 256
Written November 9, 2019 by Eric Olson in K&R C for PDP-11

Less copying, more multiplication less division.
Avoid computing T(s) when s doesn't have enough factors.  */
unsafe extern "C" fn tfree(mut k: libc::c_long, mut l: libc::c_long)
-> libc::c_int {
let mut n: libc::c_long = l / k;
let mut lmin: libc::c_long =
   (k + 1i32 as libc::c_long) * n + 2i32 as libc::c_long;
let mut lmax: libc::c_long =
   (k - 1i32 as libc::c_long) * (n + 1i32 as libc::c_long) -
       2i32 as libc::c_long;
return (lmin <= l && l <= lmax) as libc::c_int;
}
unsafe extern "C" fn ppow(mut p: libc::c_long, mut n: libc::c_char)
-> libc::c_long {
let mut r: libc::c_long = 0;
if n == 0 { return 1i32 as libc::c_long }
r = 1i32 as libc::c_long;
loop  {
   if n as libc::c_int & 1i32 != 0 { r *= p }
   n = (n as libc::c_int >> 1i32) as libc::c_char;
   if n == 0 { return r }
   p *= p
};
}
static mut Pn_: libc::c_int = 0;
static mut P_: [libc::c_long; 1300] = [0; 1300];
static mut smin: libc::c_long = 0;
unsafe extern "C" fn isprime(mut p: libc::c_long) -> libc::c_long {
// P_, Pn_
let mut i: libc::c_int = 0;
i = 0i32;
while i < Pn_ {
   if p % P_[i as usize] == 0 { return 0i32 as libc::c_long }
   i += 1
}
return 1i32 as libc::c_long;
}
static mut smax: libc::c_int = 100000000i64 as libc::c_int;
unsafe extern "C" fn doinit() {
// P_, Pn_
let mut i: libc::c_int = 0; // x_
let mut p: libc::c_long = 0; // x_, z_
let mut r: libc::c_long = 0;
smin = (smax + 2i32) as libc::c_long;
P_[0] = 2i32 as libc::c_long;
Pn_ = 1i32;
p = 3i32 as libc::c_long;
while Pn_ < 1300i32 {
   if isprime(p) != 0 {
       let fresh0 = Pn_;
       Pn_ = Pn_ + 1;
       P_[fresh0 as usize] = p
   }
   p += 1
}
if p <= smax as libc::c_long / p + 1i32 as libc::c_long {
   printf(b"The maximum prime %ld is too small!\n\x00" as *const u8 as
              *const libc::c_char, p);
   exit(1i32);
}
r = 1i32 as libc::c_long;
i = 0i32;
while i < 10i32 - 1i32 {
   if P_[i as usize] > smax as libc::c_long / r + 1i32 as libc::c_long {
       return
   }
   r *= P_[i as usize];
   i += 1
}
printf(b"Distinct primes %d in factorisation too few!\n\x00" as *const u8
          as *const libc::c_char, 10i32);
exit(2i32);
}
#[no_mangle]
pub static mut x_: Factors =
Factors{s: 0, fmax: 0, i: 0, p: [0; 10], n: [0; 10],};
static mut z_: [libc::c_char; 10] = [0; 10];
unsafe extern "C" fn sigma() -> libc::c_long {
let mut i: libc::c_int = 0;
let mut r: libc::c_long = x_.n[0] as libc::c_long;
i = 1i32;
while i <= x_.fmax {
   r *= (x_.n[i as usize] as libc::c_int + 1i32) as libc::c_long;
   i += 1
}
return r;
}
unsafe extern "C" fn T() -> libc::c_long {
let mut r: libc::c_int = 0;
let mut w: libc::c_int = 0;
w = 0i32;
while w < 10i32 { z_[w as usize] = 0i32 as libc::c_char; w += 1 }
r = 0i32;
loop  {
   let mut i: libc::c_int = 0;
   let mut k: libc::c_long = 0;
   let mut l: libc::c_long = 0;
   i = 0i32;
   while i <= x_.fmax {
       if (z_[i as usize] as libc::c_int) <
              x_.n[i as usize] as libc::c_int {
           z_[i as usize] += 1;
           break ;
       } else { z_[i as usize] = 0i32 as libc::c_char; i += 1 }
   }
   if i > x_.fmax { break ; }
   k = 1i32 as libc::c_long;
   l = 1i32 as libc::c_long;
   i = 0i32;
   while i <= x_.fmax {
       k *= ppow(x_.p[i as usize], z_[i as usize] as libc::c_char);
       l *=
           ppow(x_.p[i as usize],
                x_.n[i as usize] as libc::c_char -
                    z_[i as usize] as libc::c_char);
       i += 1
   }
   if k <= l { r += tfree(k, l) }
}
return r as libc::c_long;
}
static mut Tisn: libc::c_int = 0;
unsafe extern "C" fn Twork() {
// x_, P_, Tisn
let mut i: libc::c_int = 0;
let mut r: libc::c_int = 0;
let mut s: libc::c_long = 0;
let mut fmax: libc::c_long = 0;
let mut pmax: libc::c_long = 0;
let mut p: libc::c_long = 0;
s = x_.s;
r = sigma() as libc::c_int;
if r >= Tisn {
   r = T() as libc::c_int;
   if r == Tisn && s < smin { smin = s }
}
i = x_.i;
fmax = x_.fmax as libc::c_long;
pmax = smax as libc::c_long / s + 1i32 as libc::c_long;
p = P_[i as usize];
if p <= pmax {
   x_.n[fmax as usize] += 1;
   x_.s = s * p;
   Twork();
   x_.n[fmax as usize] -= 1
}
fmax += 1;
x_.n[fmax as usize] = 1i32 as libc::c_char;
i += 1;
while i < 1300i32 {
   p = P_[i as usize];
   if p > pmax { break ; }
   x_.p[fmax as usize] = p;
   x_.s = s * p;
   x_.i = i;
   x_.fmax = fmax as libc::c_int;
   Twork();
   i += 1
}
x_.n[fmax as usize] = 0i32 as libc::c_char;
}
unsafe extern "C" fn Tinv(mut n: libc::c_int) -> libc::c_long {
// x_, P_, Tisn
Tisn = n;
x_.p[0] = P_[0];
x_.n[0] = 1i32 as libc::c_char;
x_.i = 0i32;
x_.s = 2i32 as libc::c_long;
x_.fmax = 0i32;
Twork();
return if smin < smax as libc::c_long {
          smin
      } else { -1i32 as libc::c_long };
}
unsafe fn main_0() -> libc::c_int {
let mut n: libc::c_int = 200i32;
doinit();
printf(b"T(%ld)=%d\n\x00" as *const u8 as *const libc::c_char, Tinv(n),
      n);
return 0i32;
}
pub fn main() { unsafe { ::std::process::exit(main_0() as i32) } }
Amazingly it actually works after fixing a couple of C undefined behaviors it did not translate as we like.

Could some kind soul with a Pi 4 give that a run and let me know if it gets Rust into the one cabbage region for performance?

As far as I can tell it is 5 or 6 times faster than the previous Rust effort and may even match the original limited.c

If it's in the ball park that will give me the motivation to hand code a proper Rust rendition.

John will be pleased to hear this submission probably does not qualify as it uses a non-standard Rust package (crate), libc.rs

You will need to build it with the cargo tool

Code: Select all

$ cargo build --release
   Compiling libc v0.2.65
   Compiling limited_rust v0.1.0 (/mnt/c/Users/michael/limited_rust)
    Finished release [optimized] target(s) in 3.96s
$ time ./target/release/limited_rust
T(85765680)=200

real    0m0.908s
user    0m0.859s
sys     0m0.031s

Everything required is in the attached zip.
Attachments
limited_rust.zip
(17.18 KiB) Downloaded 23 times
Last edited by Heater on Mon Nov 18, 2019 7:02 pm, edited 1 time in total.
Memory in C++ is a leaky abstraction .

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 7:00 pm

jcyr,

Thanks for the tatami link. I had actually found that before.

It's one of those nice explanations, beloved of mathematicians, that includes the magical phrase " it's easy to see that..."

This is often dropped casually in to maths lectures. Usually twenty minutes after one's brain has frozen over and gone numb and no one can bloody well not see anything anymore.

I think maths profs get some perverse pleasure out of doing that. They know what anguish is going on in the room full of students minds before them!
Memory in C++ is a leaky abstraction .

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 9:30 pm

jcyr,
I would if I could, but as usual rust won't cooperate!
Hmm... curious. I have never had that fail on a bunch of Pi, on Windows 10, on Linux running desktops and servers....

I just tried it again on a Pi. No problem.

Can't say for a Pi 4 mind...
Memory in C++ is a leaky abstraction .

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 9:43 pm

So ScriptBasic has been removed.

My last challenge here.

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 10:00 pm

I get about 6 seconds for limited_rust on my Pi 3B

Code: Select all

[email protected]:~/limited_rust $ time ./target/release/limited_rust
T(85765680)=200

real    0m6.131s
user    0m6.121s
sys     0m0.010s
I was hoping to get into single cabbage territory on the Pi 4. I prefer brussel sprouts.
Memory in C++ is a leaky abstraction .

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 10:35 pm

Cool, you need a 64 bit Rust.
Memory in C++ is a leaky abstraction .

ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 10:40 pm

jcyr wrote:
Mon Nov 18, 2019 10:23 pm
Heater wrote:
Mon Nov 18, 2019 10:00 pm
I get about 6 seconds for limited_rust on my Pi 3B

Code: Select all

[email protected]:~/limited_rust $ time ./target/release/limited_rust
T(85765680)=200

real    0m6.131s
user    0m6.121s
sys     0m0.010s
I was hoping to get into single cabbage territory on the Pi 4. I prefer brussel sprouts.
Figured out the rust install problem. I'm running the 64-bit kernel so uname yields architecture aarch64 even in 32 bit mode. That was screwing up the rust install script.
Here are your Pi4 results:

Code: Select all

[email protected]:~/limited_rust $ cargo build --release
    Updating crates.io index
  Downloaded libc v0.2.65
   Compiling libc v0.2.65
   Compiling limited_rust v0.1.0 (/home/pi/limited_rust)
    Finished release [optimized] target(s) in 24.17s
[email protected]:~/limited_rust $ time target/release/limited_rust 
T(85765680)=200

real    0m3.004s
user    0m2.994s
sys     0m0.011s
That would get second place in the star chart... but needs to be made legible.
Would it be possible to install time using

apt-get install time

and then type

$ /usr/bin/time target/release/limited_rust

to make a timing that shows memory usage?

From a computer literacy point of view, it would be very interesting if the algorithm became more clear with a rewrite in Rust. Given the recursive way the factors for s are generated, I think Haskell might also be able to express this algorithm in human-readable form rather well.

Heater
Posts: 14437
Joined: Tue Jul 17, 2012 3:02 pm

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 11:01 pm

You mean like this on my Pi 3:

Code: Select all

$ /usr/bin/time ./target/release/limited_rust
T(85765680)=200
6.14user 0.00system 0:06.15elapsed 99%CPU (0avgtext+0avgdata 1568maxresident)k
0inputs+0outputs (0major+96minor)pagefaults 0swaps
I guess memory usage won't change on the Pi 4 :)

My problem is that limited.c does everything in global variables. That is a no-no in Rust.

So I was wondering if I should wrap everything into a struct with methods, kind of like a C++ object.
Or pass references to that data as parameters to free standing functions that need them.

Either way it will likely introduce a bit of indirection everywhere and slow things down a bit.
Memory in C++ is a leaky abstraction .

ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 11:12 pm

John_Spikowski wrote:
Mon Nov 18, 2019 9:43 pm
So ScriptBasic has been removed.

My last challenge here.
You asked that it be removed. It is easy to put back. Would you like it to be put back?

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 11:13 pm

For the record ScriptBasic satisfied the T(s)=200 Tatami challenge with the following stats on the RPi 4B.

Execution Time: 23 seconds
Memory: 49 MB
BASIC Statements: 35

ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 11:20 pm

John_Spikowski wrote:
Mon Nov 18, 2019 11:13 pm
For the record ScriptBasic satisfied the T(s)=200 Tatami challenge with the following stats on the RPi 4B.

Execution Time: 23 seconds
Memory: 49 MB
BASIC Statements: 35
Is there now a general-purpose array extension that can be used instead of the custom library you wrote before?

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 11:23 pm

The only difference between doing it in an extension module or native in the interpreter is my time.

I'm working on a Judy extension module that will replace the ta experimental array class.

ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Mon Nov 18, 2019 11:50 pm

Heater wrote:
Mon Nov 18, 2019 11:01 pm
You mean like this on my Pi 3:

Code: Select all

$ /usr/bin/time ./target/release/limited_rust
T(85765680)=200
6.14user 0.00system 0:06.15elapsed 99%CPU (0avgtext+0avgdata 1568maxresident)k
0inputs+0outputs (0major+96minor)pagefaults 0swaps
I guess memory usage won't change on the Pi 4 :)

My problem is that limited.c does everything in global variables. That is a no-no in Rust.

So I was wondering if I should wrap everything into a struct with methods, kind of like a C++ object.
Or pass references to that data as parameters to free standing functions that need them.

Either way it will likely introduce a bit of indirection everywhere and slow things down a bit.
Keep in mind that the existing limited.c code was optimised for the original Kernighan and Ritchie compiler with vintage PDP-11 hardware. On a modern processor, passing pointers and the apparent indirection didn't hurt performance. What I found even more surprising was that computing powers by squares was not a clear winner over simply multiplying p by itself n times.

From a literacy point of view, I'm looking forward to reading some Rust code that doesn't have so many mut variables.

Speaking of mutts, Fido was proudly showing off a parallel program written in collaboration with some zombies from the digital apocalypse. Since dogs don't like cabbage, the source code apparently consists of a single line. Editing is reportedly very difficult. I wonder how readability compares with the code generated by c2rust.
Last edited by ejolson on Tue Nov 19, 2019 12:21 am, edited 1 time in total.

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Tue Nov 19, 2019 12:04 am

jcyr wrote:
Mon Nov 18, 2019 11:35 pm
John_Spikowski wrote:
Mon Nov 18, 2019 11:23 pm
The only difference between doing it in an extension module or native in the interpreter is my time.
I think another difference is that the native interpreter couldn't handle 200. That's a fail in my book.
C is C no matter where it's compiled and used.

ejolson
Posts: 4254
Joined: Tue Mar 18, 2014 11:47 am

Re: Liberation through Computer Literacy

Tue Nov 19, 2019 12:18 am

John_Spikowski wrote:
Mon Nov 18, 2019 11:23 pm
The only difference between doing it in an extension module or native in the interpreter is my time.

I'm working on a Judy extension module that will replace the ta experimental array class.
For me there is no difference between an inbuilt language feature and using a general purpose library or extension.

In either case, from a beginner's point of view the exact number of lines is not as important as how easy those lines were to write. Unfortunately, I don't currently have a supply of independent identically distributed beginners available with whom to conduct a reasonable survey. Therefore, I simply counted the lines with wc to determine the yellow stars.

User avatar
John_Spikowski
Posts: 1614
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Liberation through Computer Literacy

Tue Nov 19, 2019 12:24 am

For me there is no difference between an inbuilt language feature and using a general purpose library or extension.
Exactly.

I wonder if the C submissions could get by without include files?

Return to “General programming discussion”