-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
65 lines (60 loc) · 1.92 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "lexer.h"
#include "parser.h"
#include <chrono>
#include <iostream>
#include <ostream>
#include <pstl/glue_execution_defs.h>
#include <ratio>
#include <string>
#include <vector>
#include <version>
#include <future>
#include <ranges>
#include <numeric>
#include <thread>
#include <execution>
#include "llvm/Config/abi-breaking.h"
// TODO: fix to build correctly eventually
int llvm::DisableABIBreakingChecks = 1;
int main() {
// just to make it feel like something's happening
const auto start = std::chrono::high_resolution_clock::now();
int done = 0;
std::vector<std::jthread> results{};
for (int i = 0 ; i < 1000; ++i) {
results.push_back(std::jthread([](){
std::vector<int> nums{};
for (int i = 100000; i > -1000; --i) {
nums.push_back(i);
}
std::sort(nums.begin(), nums.end());
}));
}
for (auto& result : results) result.join();
const auto finish = std::chrono::high_resolution_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(finish - start).count() << std::endl;
// it actually starts now...
std::cout << "The version of C++ that clang is using is: " << __cplusplus << std::endl;
while (true) {
std::cout << "> ";
BallLang::Token token = BallLang::getTok();
switch(token.type) {
case BallLang::TokenType::ENDOFFILE:
return 0;
case BallLang::TokenType::ENDOFLINE:
break;
case BallLang::TokenType::DEF:
handleDefinition(std::move(token));
break;
case BallLang::TokenType::EXTERN:
handleExtern(std::move(token));
break;
default:
handleTopLevel(std::move(token));
break;
}
// eat newline character that comes after
std::cin.ignore();
}
return 0;
}